Here is Prob. 10, 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})$.
(a) If $\nabla f ( \mathbf{x} ) = \mathbf{O}$ for every $\mathbf{x}$ in $B(\mathbf{a})$, prove that $f$ is constant on $B(\mathbf{a})$.
(b) If $f( \mathbf{x} ) \leq f( \mathbf{a} ) $ for all $\mathbf{x}$ in $B(\mathbf{a})$, prove that $\nabla f ( \mathbf{a} ) = \mathbf{O}$.
My Attempt:
Part (a)
Here is a recent post of mine here on Mathematics Stack Exchange where I have proved what has been stated in Part (a) above. Is my proof, which is toward the end of that post over there, correct? Or, are there any problems therein?
Part (b)
Since $f$ is differentiable on $B(\mathbf{a})$, for every $\mathbf{y} \in \mathbb{R}^n$ the directional derivative $f^\prime( \mathbf{a}; \mathbf{y} )$ exists, that is, the limit $$ \lim_{ h \to \infty} \frac{ f( \mathbf{a} + h \mathbf{y} ) - f( \mathbf{a} ) }{h} $$ exists in $\mathbb{R}$.
If $f( \mathbf{x} ) \leq f( \mathbf{a} ) $ for all $\mathbf{x}$ in $B(\mathbf{a})$, then, for every $\mathbf{y} \in \mathbb{R}^n$ and for every $h \neq 0$ and $h$ so small that the point $\mathbf{a} + h \mathbf{y}$ is also in $B(\mathbf{a})$, we find that $$ \frac{ f( \mathbf{a} + h \mathbf{y} ) - f( \mathbf{a} ) }{h} \ \begin{cases} \leq 0 \ & \ \mbox{ if } \ h > 0, \\ \geq 0 \ & \ \mbox{ if } \ h < 0; \end{cases} $$ therefore $$ \lim_{h \to 0+0 } \frac{ f( \mathbf{a} + h \mathbf{y} ) - f( \mathbf{a} ) }{h} \leq 0, \qquad \mbox{ and } \qquad \lim_{h \to 0-0} \frac{ f( \mathbf{a} + h \mathbf{y} ) - f( \mathbf{a} ) }{h} \geq 0. $$ Hence we must have $$ f^\prime( \mathbf{a}; \mathbf{y} ) = \lim_{ h \to \infty} \frac{ f( \mathbf{a} + h \mathbf{y} ) - f( \mathbf{a} ) }{h} = 0 \tag{1} $$ for every $\mathbf{y} \in \mathbb{R}^n$.
In particular, if $\mathbf{y}$ is taken to equal the $n$ unit coordinate vectors $\mathbf{e}_1, \ldots, \mathbf{e}_n$, then we can conclude from (1) that $$ D_k f (\mathbf{a}) = f^\prime \left( \mathbf{a}; e_k \right) = 0 $$ for each $k = 1, \ldots, n$. Hence $$ \nabla f( \mathbf{a}) = \left( D_1 f(\mathbf{a}), \ldots, D_n f(\mathbf{a}) \right) = \mathbf{O}. $$
Is my proof correct and clear enough in each and every step of it? Are there problems in it of either logic or clarity?