Dualities in mathematics from a categorical viewpoint