I will begin by giving a brief overview of rigidity and flexibility results in nonlinear PDE, a prime example being the case of isometric embeddings. In two dimensions, the rigidity/flexibility of isometric embeddings is closely related to rigidity/flexibility of non-convex solutions to the Monge-Ampère equation. I will then discuss a recent result, obtained with R. Tione, which gives a complete rigidity result for solutions of the Monge-Ampère equation in general dimension, as conjectured by Šverák in 1992. The proof relies on Morse theory for non-smooth functions.