Let $U\subset \mathbb{R}^n$ be open and connected and $f:U\rightarrow \mathbb{R}$ differentiable so that $\partial_1f(x)=0$, $\forall x\in U$. Prove or disprove that the value of $f(x)$ for $x=\{x_1,...,x_n\}\in U$ does not depend on $x_1$.
I tried proving that it is true, but I haven't been able to make any headway which makes me believe that there exists a counterexample. Does anyone have a hint to proceed?
Here is a counterexample:
Let $U$ be the $(x,y)$-plane with the positive $y$-axis removed, and consider on $U$ the function $$f(x,y):=\left\{\eqalign{y^2\>{\rm sgn}(x)\qquad&(y>0)\cr 0\qquad\qquad&(y\leq0)\ .\cr}\right.$$ This function is $C^1$ on $U$, has ${\partial f\over\partial x}\equiv0$ on $U$, but cannot be written as $f(x,y)=\psi(y)$.
But locally the conjectured claim is true: If ${\partial f\over\partial x}\equiv0$ in a rectangular neighborhood $Q$ of $(x_0,y_0)$ then $f(x,y)\equiv\psi(y)$ in $Q$.