TITLE: Why does zero derivative imply a function is locally constant?
QUESTION [8 upvotes]: I've been trying to prove to myself that if $\Omega$ is an open connected set in $\mathbb{R}^n$, then if $f\colon\Omega\to\mathbb{R}^m$ is a differentiable function such that $f'(x)=0$ for all $x\in\Omega$, then $f$ is constant. 
I've reduced the problem to just showing $f$ is locally constant on $\Omega$. Given $x_0\in\Omega$, I know that 
$$
\lim_{x\to x_0}\frac{\|f(x)-f(x_0)-f'(x_0)(x-x_0)\|}{\|x-x_0\|}=\lim_{x\to x_0}\frac{\|f(x)-f(x_0)\|}{\|x-x_0\|}=0.
$$
This implies $\lim_{x\to x_0}\|f(x)-f(x_0)\|=0$. So for any $\epsilon>0$, there exists some open ball $B(x_0,\delta)$ around $x_0$ in $\Omega$ such that $\|f(x)-f(x_0)\|<\epsilon$ for $x\in B(x_0,\delta)$. But since the choice of the open ball changes with $\epsilon$, I don't think I can conclude $\|f(x)-f(x_0)\|=0$ for $x\in B$. So this doesn't convince me that there actually exists a neighborhood of $x_0$ on which $f$ is constant. 
How can you make the leap from zero derivative to locally constant?

REPLY [5 votes]: A cute direct proof (styled after path connectedness ones) is to pick any point $x$ in the domain and consider the set $U$ on which $f$ takes the value $f(x)$ and the set $V$ on which it does not take this value. These sets are non empty if the hypothesis fails. Clearly $V$ is open, so we are done if $U$ is open.
It is enough to prove that around any $y\in U$ there is a ball also in $U$. But choosing any ball $U'$ containing $y$, we note that any other point $x'\in U'$ is connected to $y$ by a line, and that the function restricted to that line is differentiable with derivative zero.
Now it is a standard 1D problem. If we consider a function $g(t)=f(y+t(x'-y))-f(y)-\Delta t$ on that line with $\Delta$ chosen such that $g$ vanishes at either end, then it achieves its maximum/minimum at some point and its derivative vanishes there. This implies $\Delta$ is zero and so $f$ took the same value at either end. (This is a compressed proof/reminder of MVT and Rolle.)