Let $f:\mathbb{R}^2\to\mathbb{R}$ be a $C^1$ function. Prove that the restriction is not injective. Let $f:\mathbb{R}^2\to\mathbb{R}$ be a $C^1$ function. And let $D$ an open subset of $\mathbb{R}^2$. Prove that the restriction of $f$ to $D$ is not injective.
Im trying to solve this but i dont know how...
The problem have a hint: Use the inverse theorem applied to an appropiate transformation in $\mathbb{R}^2$. 

$f|_D$ cannot be injective. Now $f$ is not constant (because then it cannot be injective), so that $Df\neq 0$.Let $x$ be a point where $Df \neq 0$. Since $f$ is $C^1$, there exists a 'hood $U_x$ of $x$ where $Df(y) \neq 0 $. This means, by the inverse function theorem, that $f |_{U_x} \rightarrow f(U_x)$ is a diffeomorphism, so that there is a differentiable local inverse. But, by a dimension argument, using Sard's theorem, this is not possible: every point in $f(U_x) \subset \mathbb R$ is a critical point of $Df^{-1}|_{U_x}$, i.e., the image of $f^{-1}|_{U_x}$ has measure zero in $\mathbb R^2$ , so, in particular, $f^{-1}|_{U_x}$ cannot map into the open set $U_x$ , contradicting the existence of the local diffeomorphism.
