Here is Prob. 9, Exercises 8.14, in the book Calculus Vol II by Tom M. Apostol, 2nd edition:
Assume $f$ is differentiable at each point of an $n$-ball $B(\mathbf{a})$. If $f^\prime( \mathbf{x}; \mathbf{y} ) = 0$ for $n$ independent vectors $\mathbf{y}_1, \ldots, \mathbf{y}_n$ and for every $\mathbf{x}$ in $B(\mathbf{a})$, prove that $f$ is constant on $B(\mathbf{a})$.
My Attempt:
First we note that the $n$ independent vectors $\mathbf{y}_1, \ldots, \mathbf{y}_n$ form a basis of $\mathbb{R}^n$ and hence every vector in $\mathbb{R}^n$ can be written (in a unique way) as a linear combination of these vectors.
Since $f$ is differentiable at each point of $B(\mathbf{a})$, therefore $f$ is continuous on $B( \mathbf{a})$.
Since $f$ is differentiable at each point $\mathbf{x} \in B(\mathbf{a})$, all the partial derivatives $D_1 f( \mathbf{x}), \ldots, D_n f(\mathbf{x})$ of $f$ exist, and for every $\mathbf{y} \in \mathbb{R}^n$, we have $$ f^\prime( \mathbf{x}; \mathbf{y} ) = \nabla f(\mathbf{x} ) \cdot \mathbf{y}. \tag{1}$$
Let $\mathbf{x}$ be an arbitrary point in the $n$-ball $B(\mathbf{a})$. If $f^\prime( \mathbf{x}; \mathbf{y} ) = 0$ for the $n$ independent vectors $\mathbf{y}_1, \ldots, \mathbf{y}_n$, then using (1) we can conclude that $$ \nabla f(\mathbf{x}) \cdot \mathbf{y}_k = 0 $$ for each $k = 1, \ldots, n$. Suppose that $\left( \alpha_1, \ldots, \alpha_n \right)$ be the unique $n$-tuple of scalars for which $$ \nabla f(\mathbf{x} ) = \sum_{k=1}^n \alpha_k \mathbf{y}_k. $$ Then using the familiar properties of the dot product we find that $$ \begin{align} \lVert \nabla f(\mathbf{x} ) \rVert^2 &= \nabla f(\mathbf{x} ) \cdot \nabla f(\mathbf{x} ) \\ &= \nabla f(\mathbf{x} ) \cdot \left( \sum_{k=1}^n \alpha_k \mathbf{y}_k \right) \\ &= \sum_{k=1}^n \alpha_k \left( \nabla f(\mathbf{x} ) \cdot \mathbf{y}_k \right) \\ &= 0, \end{align} $$ and therefore $$ \nabla f(\mathbf{x} ) = \mathbf{O} $$ for every point $\mathbf{x}$ in the open ball $B(\mathbf{a})$. Hence $$ D_1 f( \mathbf{x} ) = \cdots = D_n f( \mathbf{x} ) = 0 \tag{2} $$ for every point $\mathbf{x}$ in $B(\mathbf{a})$.
Now let $\mathbf{p} = \left( p_1, \ldots, p_n \right)$ and $\mathbf{q} = \left( q_1, \ldots, q_n \right)$ be any two points in $B(\mathbf{a})$. Let us form the points $\mathbf{v}_1, \ldots, \mathbf{v}_{n-1}$ as follows:
$$ \mathbf{v}_1 = \left( q_1, p_2, \ldots, p_n \right), \ \mathbf{v}_2 = \left( q_1, q_2, p_3, \ldots, p_n \right), \ \ldots, \ \mathbf{v}_{n-1} = \left( q_1, q_2, \ldots, q_{n-1}, p_n \right). $$As the points $\mathbf{p}$ and $\mathbf{v}_1$ both lie in $B(\mathbf{a})$, so does the line segment jointing these two points, which is the set $$\left\{ \ (1-\lambda) \mathbf{p} + \lambda \mathbf{v}_1 \ \colon \ 0 \leq \lambda \leq 1 \ \right\} = \left\{ \ \left( (1-\lambda) p_1 + \lambda q_1, p_2, \ldots, p_n \right) \ \colon \ 0 \leq \lambda \leq 1 \ \right\}. $$ So by the mean value theorem we can find a real number $\lambda \in (0, 1)$ such that $$ f( \mathbf{p} ) - f \left( \mathbf{v}_1 \right) = D_1 f \left( (1-\lambda) \mathbf{p} + \lambda \mathbf{v}_1 \right), $$ and hence by virtue of (2) we can conclude that $$ f( \mathbf{p} ) = f \left( \mathbf{v}_1 \right). \tag{3} $$
Now as the points $\mathbf{v}_1$ and $\mathbf{v}_2$ both lie in $B(\mathbf{a})$, so does the line segment joining these two points, which is the set $$ \left\{ \ (1-\lambda) \mathbf{v}_1 + \lambda \mathbf{v}_2 \ \colon \ 0 \leq \lambda \leq 1 \ \right\} = \left\{ \ \left( q_1, (1-\lambda) p_2 + \lambda q_2, p_3, \ldots, p_n \right) \ \colon \ 0 \leq \lambda \leq 1 \ \right\}. $$ So by the mean value theorem we can find a real number $\lambda \in (0, 1)$ such that $$ f \left( \mathbf{v}_1 \right) - f \left( \mathbf{v}_2 \right) = D_2 f \left( (1-\lambda) \mathbf{v}_1 + \lambda \mathbf{v}_2 \right), $$ and hence by virtue of (2) we can conclude that $$ f \left( \mathbf{v}_1 \right) = f \left( \mathbf{v}_2 \right). \tag{4} $$
Continuing in this way, we can finally show that $$ f \left( \mathbf{v}_{n-1} \right) = f \left( \mathbf{q} \right). \tag{5} $$
From the preceding three paragraphs we can conclude that $$ f( \mathbf{p} ) = f \left( \mathbf{v}_1 \right) = \cdots = f \left( \mathbf{v}_{n-1} \right) = f \left( \mathbf{q} \right), $$ and hence $$ f( \mathbf{p} ) = f \left( \mathbf{q} \right) $$ for any two points $\mathbf{p}$ and $\mathbf{q}$ in $B( \mathbf{a} )$.
This shows that $f$ is constant on $B( \mathbf{a})$.
Is this proof satisfactory enough? If so, then is it also clear and articulate enough in each and every step thereof? If not, then where are the issues in it?