The function $f(x)$ exists in an open interval $(a,b)$ and is differentiable there. Let $c$ be a point that exists in the open interval $(a,b)$, and $f(x)$ has its maximum value at $x=c$. How do I prove that $f'(c)=0$?
(The unit name is mean value theorem.)
Since $(a,b)$ is open, there exists $\sigma>0$ such that $c+h\in(a,b)$ for all $\sigma$ such that $|h|<\sigma$. Moreover, $$\Delta y=f(c+h)-f(c)\leq 0$$ Therefore, $\frac{\Delta y}{h}\geq 0$ if $-\sigma<h<0$ and $\frac{\Delta y}{h}\leq 0$ if $0<h<\sigma$.
Taking limit for $h\to 0^{-}$ e for $h\to 0^{+}$, we may conclude that $(D_{-}f(x))_{x=c}\geq 0$ and that $(D_{+}f(x))_{x=c}\geq 0$. Since $f$ is differentiable at $x=c$, we get that $$f'(c)=(D_{-}f(x))_{x=c}=(D_{+}f(x))_{x=c}=0$$
Same conclusion if $c$ is a minimum value point.