Global inversion theorems and applications to differential equations