Suppose that the function $f:\mathbb{R}^2\to\mathbb{R}$ has first order partial derivatives and that $$\frac{\partial f}{\partial x}(x,y)=\frac{\partial f}{\partial y}(x,y)=0\qquad\text{for all $(x,y)\in\mathbb{R}^2$}$$ Prove that the function $f:\mathbb{R}^2\rightarrow\mathbb{R}$ is constant.
Since $\frac{\partial f}{\partial x}(x,y)=\frac{\partial f}{\partial y}(x,y)=0$ for all $(x,y)\in\mathbb{R}^2$, so $\nabla f(x,y)=0$. Let $(x_1,y_1),(x_2,y_2)\in\mathbb{R}^2$. Define $\gamma:\mathbb{R}\to\mathbb{R}^2$ be a differentiable mapping with $\gamma(0)=(x_1,y_1)$ and $\gamma(1)=(x_2,y_2)$. Now, let $g=f\circ\gamma:\mathbb{R}\to\mathbb{R}$, then we have $g'(t)=\nabla f(\gamma(t))\cdot\gamma'(t)=0$ for all $t\in\mathbb{R}$. $g$ is constant on $[0,1]$, thus, $f(x_1,y_1)=f(\gamma(0))=g(0)=g(1)=f(\gamma(1))=f(x_1,y_1)$ which implies $f$ is a constant.
I am looking for different ways to show $f$ is constant. Can someone give me a hint or suggestion to start with a new way? Thanks
Hint/Suggestion: If a function is constant almost everywhere, then it is either a horizontal plane or piece-wise horizontal planar, where changes in the $Z$ value of the plane occur at the discontinuities.
Show that the existence of the derivative at all points implies that it is horizontal planar and continuous, in which case it must be a horizontal plane (constant).