If f is differentiable on a connected open set S..

and $\displaystyle \partial_{x_{1}}f(x) = 0$ for all $\displaystyle x\in S$, must $\displaystyle f$ be independent of $\displaystyle x_{1}$, that is, given $\displaystyle a,b$ where $\displaystyle a_{j} = b_{j}$ for all $\displaystyle j \ne 1$, then $\displaystyle f(a)=f(b)$.

So I know how to show this is true if $\displaystyle S$ is convex (because then I can use the Mean Value Theorem), but I am having a hard time coming up with such a function, say on a non-convex subset of $\displaystyle \mathbb{R}^{2}$, where this does not hold. Any hints or ideas would be appreciated, thanks.