I am reading "Calculus on Manifolds" by Michael Spivak.
2-37. (a) Let $f: \mathbb{R}^2 \to \mathbb{R}$ be a continuously differentiable function. Show that $f$ is not $1$-$1$.
Hint: If, for example, $D_1f(x,y) \neq 0$ for all $(x,y)$ in some open set $A$, consider $g:A \to \mathbb{R}^2$ defined by $g(x,y)=(f(x,y),y)$.
I solved this problem as follows:
(1)
Suppose that $D_1f(x,y)=0$ for all $(x,y)$ in $\mathbb{R}^2$.
Let $y_0$ be an arbitrary real number.
Then, $D_1f(x,y_0)=0$ for all $x\in\mathbb{R}$.
So, by the mean value theorem, $f(x,y_0)=c$ for some real number $c$.
Let $x_1,x_2$ be two different real numbers.
Since $x_1\neq x_2$, $(x_1,y_0)\neq (x_2,y_0)$.
But, $f(x_1,y_0)=c=f(x_2,y_0)$.
So, $f:\mathbb{R}^2\to\mathbb{R}$ is not injective.
(2)
Suppose that $D_1f(x,y)\neq 0$ for some $(x,y)$ in $\mathbb{R}^2$.
Suppose that $D_1f(x_0,y_0)\neq 0$.
Consider $g:A\to\mathbb{R}^2$ such that $g(x,y)=(f(x,y),y)$.
Then, $g$ is continuously differentiable on $\mathbb{R}^2$.
And, $\det g'(x_0,y_0)=\det \pmatrix{D_1f(x_0,y_0)&D_1f(x_0,y_0)\\0&1}=D_1f(x_0,y_0)\neq 0$.
So, by the Inverse Function Theorem, there is an open set $V$ containing $(x_0,y_0)$ and an open set $W$ containing $g(x_0,y_0)$ such that $g:V\to W$ has an inverse $g^{-1}:W\to V$.
Let $(x'_1,y'_1),(x'_1,y'_2)$ be two different points in $W$.
Then, $f(g^{-1}(x'_1,y'_1))=x'_1=f(g^{-1}(x'_1,y'_2))$.
Since $g^{-1}:W\to V$ is bijective, $g^{-1}:W\to V$ is injective.
So, $g^{-1}(x'_1,y'_1)\neq g^{-1}(x'_1,y'_2)$.
So, $f$ is not injective because $f(g^{-1}(x'_1,y'_1))=x'_1=f(g^{-1}(x'_1,y'_2))$.
My question is the following:
Why did the author assume $D_1f(x,y)\neq 0$ for all $(x,y)$ in some open set $A$?
I think it is sufficient to assume that $D_1f(x,y)\neq 0$ for some $(x,y)$ in $\mathbb{R}^2$.
$D_1f$ is continuous.
So, if $D_1f(x,y)\neq 0$ for some $(x,y)$ in $\mathbb{R}^2$, then $D_1f(x,y)\neq 0$ for all $(x,y)$ in some open set $A$.
I know this, but I wonder why the author assumed that $D_1f(x,y)\neq 0$ for all $(x,y)$ in some open set $A$.