if derivative is zero, then function is constant Let $f: U \subset \mathbb{R}^2 \to \mathbb{R}$ where $U$ is open and connected. Suppose $f_x, f_y = 0$ on $U$. Can we conclude from here that $f$ must me constant ?
 A: First note that if a segment $[x,x+\lambda e_k]$ lies entirely in
$U$ (where $e_k$ is the
unit vector in the $k$th direction),
then the mean value theorem shows that $|f(x+\lambda e_k) -f(x)| \le |{\partial f(\xi) \over \partial x_k}| \|\lambda e_k\| = 0$. That is,
$f(x+\lambda e_k) = f(x)$.
If $U$ is open and connected, it is path connected (see, for example,
Show that any connected open subset of $E^n$ is arcwise connected.). That is, for any $x,y \in U$
there is some path $\gamma$ contained in $U$ such that $\gamma(0)=x,
\gamma(1) = y$.
The path may be taken to be polygonal, with each segment parallel to one of the
axes of $\mathbb{R}^n$. That is, there is a sequence of points
$x_0=x,x_1,...,x_{n-1},x_n=y$ such that
$x_{i+1} = x_i + \lambda_i e_{k_i}$, and $[x_i,x_{i+1}] \subset U$ for all $i$.
Then it follows from the first remark that $f(x) = f(x_2) = \cdots = f(x_{n-1}) = f(y)$. It follows that $f$ is constant in $U$.
Aside: 
We show that we can take the path to be polygonal, with each segment parallel to one of the axes, let
$d(x) = \min_{y \not \in U} \|x-y\|_\infty$. The $\min$ exists because $U^c$ is
closed and we are in a finite dimensional space.
I am using the $\infty$ norm for convenience, in particular, if
$y \in B(x,\epsilon)$, then it should be clear that the path
$x \to x+(y_1-x_1) e_1 \to x+\sum_{i=1}^2(y_i-x_i) e_i \to \cdots \to y$ lies
entirely in $B(x,\epsilon)$ and each segment is parallel to the axes.
Now let
$\epsilon' = \min_{t \in [0,1]} d(\gamma(t))$. It is clear that $\epsilon'>0$
since $U$ is open. In particular, note that if $\epsilon < \epsilon'$, then $B(\gamma(t), \epsilon) \subset U$.
Since $[0,1]$ is compact, $\gamma$ is uniformly continuous.
Now choose
$\epsilon >0$ with $\epsilon < \epsilon'$, then 
there is some $\delta>0$ such that if $|t-s| < \delta$, then
$\| \gamma(t)-\gamma(s)\|_\infty < \epsilon$. Hence there is a sequence
$t_0=0 < t_1 < \cdots < t_n = 1$ such that $\| \gamma(t_{i+1})-\gamma(t_i)\|_\infty < \epsilon$. In particular, $\gamma(t_{i+1}) \in B(\gamma(t_i), \epsilon)$, and from an earlier remark, we see that there is a path
from $\gamma(t_i)$ to $\gamma(t_{i+1})$ that lies
entirely in $B(\gamma(t_i),\epsilon)$ and each segment is parallel to the axes.
Joining all the paths together gives the required path.
