Partial derivatives are zero in a ball implies $f$ is constant on the ball 
Let $r>0$ and $\vec{a}\in \mathbb{R}^n$ and $\vec{f}:B(\vec{a},r)\to \mathbb{R}^m$ be any function such that all the first partial derivatives exist on $B(\vec{a},r)$ and for every $\ j\in\{1,2,\ldots,n\}, $  satisfy $\frac{\partial f}{\partial x_j}(\vec{x})=\vec{0},$ for every $\vec{x} \in B(\vec{a},r)$. Then $f$ has only one value on $B(\vec{a},r)$.

I tried it as follows:  Since $\frac{\partial f}{\partial x_j}(\vec{x})=\vec{0},\implies f$ is a function of remaining variables, namely $x_1,\ldots.x_{j-1},x_{j+1},\ldots,x_n$. But again the partial derivative is zero which implies $f$ is the function of remaining $(n-2)$ variables. Repeating this argumnet gives me that $f$ is constant in $B(\vec{a},r)$.  
Is my reason correct?
 A: The Mean Value inequality formula in higher dimension should help:
$\|f(x)-f(y)\|\leq\|\nabla f(\xi_{x,y})\|\|x-y\|$.
Or you can use some sort of "telescoping" method, just suppose working on $n=2$: For that center of the ball $a=(a_{1},a_{2})$ and other $(x,y)$ belongs to the ball, then
\begin{align*}
f(x,y)-f(a_{1},a_{2})&=f(x,y)-f(x,a_{2})+f(x,a_{2})-f(a_{1},a_{2})\\
&=\partial_{y}f(x,\xi_{y})(y-a_{2})+\partial_{x}(\eta_{x},a_{2})(x-a_{1})\\
&=0.
\end{align*}
A: Your reasoning can be made correct. It would be correct on a cube. On a ball you need to become more flexible. You could argue that when $x, y$ are in your open ball, then they are included in a compact ball contained in the original ball. And then you can cover that compact ball with open cubes on which your above argument is valid, use compactness to restrict to a finite number of cubes, and then connect $x$ and $y$ through a sequence of overlapping cubes. So while the idea is correct, giving a rigorous formulation could be a bit nasty; in principal you can do the argument with only two cubes, I think, but again, reasoning that is not so nice...
An easy alternative would be to conclude first that $f$ is totally differentiable on the ball (follows from the continuity of the partial derivatives) and then using
$$f(y) - f(x) = (y-x) \cdot \int_0^1 \nabla f (t y + (1-t) x) dt = 0$$
A: Or you can use some sort of "telescoping" method, just suppose working on $n=2$: For that center of the ball $a=(a_{1},a_{2})$ and other $(x,y)$ belongs to the ball, then
\begin{align*}
f(x,y)-f(a_{1},a_{2})&=f(x,y)-f(x,a_{2})+f(x,a_{2})-f(a_{1},a_{2})\\
&=\partial_{y}f(x,\xi_{y})(y-a_{2})+\partial_{x}(\eta_{x},a_{2})(x-a_{1})\\
&=0.
\end{align*}
