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$.

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.
