I came across a problem in my multivariable calculus studies whose proof I don't fully understand. The problem states:
Let $f: \mathbb{R}^n \to \mathbb{R}^m$ be a differentiable and invertible function. Prove that $n = m$.
The proof goes as follows:
Note that $I = f \circ f^{-1}$, where $I$ is the identity map. Applying the chain rule, we have $Df(f^{-1}(x)) D(f^{-1})(x) = I$, which shows that the linear map $Df(f^{-1}(x))$ is invertible. Hence, $n = m$, by dimensions considertations.
My question is about the use of the chain rule in this proof. To apply the chain rule, $f^{-1}$ must be differentiable. Why is that guaranteed? Why is the inverse of a differentiable function necessarily differentiable?
Thank you in advance for your help!