As a continuation of this post, I'm starting to post my solutions (or attempts) to the exercise problems of Chapter 12 (Multivariable Differential Calculus), Mathematical Analysis by Apostol (suggested by Masacroso). Since I'm essentially self-studying, I'd really appreciate if anyone checks the solutions and let me know if there is any gap in my arguments or if there exists any cleverer solutions. Thank you.
Problem $12.1.$ Let $S$ be an open subset of $\mathbb{R}^n$, and let $f:S \to \mathbb{R}$ be a real-valued function with finite partial derivative $D_1f,\dots,D_nf$ on $S$. If $f$ has a local maximum or a local minimum at a point $c$ in $S$, prove that $D_kf\left(c\right)=0 \,\,\forall \,k$.
Solution. Suppose that $f$ has a local maximum at $c \in S$. This implies that $\exists \delta>0$ such that $$f(c) \geq f(x) \text{ for all } x \in B_{\delta}(c)=\left\{y \in S : \left\Vert y-c \right\Vert < \delta \right\} \tag1$$ Let $k \in \{1,\dots,n\}$. Now, $$D_kf(c)=\lim_{h \to 0} \frac{f(c+he_k)-f(c)}{h} \tag2$$ It is given that $(2)$ exists finitely, then $$D_kf(c)=\lim_{h \to 0;\,h \in (0,\delta)} \frac{f(c+he_k)-f(c)}{h} \leq 0 \tag3$$ On the other hand, $$D_kf(c)=\lim_{h \to 0;\,h \in (-\delta,0)} \frac{f(c+he_k)-f(c)}{h} \geq 0 \tag4$$ $(3)$ and $(4)$ $\Rightarrow$ $D_kf(c)=0$. This holds for every $k \in \{1,\dots,n\}$ and hence we are done.