We discuss the link between optimal transportation and nonlinear elliptic partial differential equations. In particular we present conditions on cost functions and domains for optimal mappings to be smooth diffeomorphisms and consider related regularity issues.