Prove that if $f$ is a real valued function on a open connected subset of $\mathbb{R}^n$ and $f_i^{'}=0$ then $f$ is constant Prove that if $f$ is a real valued function on a open connected subset $U$ of $\mathbb{R}^n$ and $f_1^{'},\ldots, f_n^{'}=0$ then $f$ is constant.

If $U$ is an open ball then it is easy. Choose any points $x=(x_1,\ldots,x_n)$ and $y=(y_1,\ldots,y_n)$ in $U$ such that $x\ne y$.
Since $U$ is a ball, the entire line segment between $x$ and $y$ lies in $U$.
Thus Taylor's theorem tells us that there is some $\zeta=(\zeta_1,\ldots, \zeta_n)$ lying on the line segment between $x$ and $y$ such that $$f(y)-f(x)=f_1^{'}(\zeta_1)(y_1-x_1) +\ldots+f_n^{'}(\zeta_n)(y_n-x_n)\mbox{.}$$
Since $f_1^{'},\ldots, f_n^{'}=0$ we get $f(y)=f(x)$. Points $x$ and $y$ were arbitrary, so $f$ is constant.
I think that what I have done is okay, but I have trouble with generalising this to the case when $U$ is not necessarily a ball. Then the whole line segment between two points is not necessarily in $U$.
 A: The path need not necessarily be straight, but you will be able to create a path from $x$ to $y$ consisting of straight lines. You already proved that the endpoints of each straight line are equal. So $x$ and $y$ are equal to.
A: I don't think your argument using Taylor is correct. It would be correct if we knew $f$ were differentiable in $U,$ but we don't have that assumption.
We need a proof that uses line seqments parallel to the axes: Suppose for convenience $U$ is the open unit disc in $\mathbb R^2.$ Assume $f:U\to \mathbb R$ and $\partial f/ \partial x,\partial f/ \partial y$ vanish in $U.$ Let $(x,y)\in U.$ Then by the one-variable mean value theorem, applied in the vertical direction, $u(x,y) = u(x,0).$ Apply the same argument in the horizontal direction to see $u(x,0) = u(0,0).$ Thus $u$ is constant in $U.$ This argument can be applied to any open disc
For general connected $U,$ the above shows $f$ is locally constant. A connectedness argument then shows $f$ is constant on $U.$
I chose $n=2$ just for convenience. The same ideas apply to any dimension.
