Let $f$ be a function defined on an interval $I$ differentiable at a point $x_o$ in the interior of $I$.
Prove that if $\exists a>0$ $ \ [x_o -a, x_o+a] \subset I$ and $ \ \forall x \in [x_o -a, x_o+a] \ \ f(x) \leq f(x_o)$, then $f'(x_o)=0$.
I did it as follows:
Let b>0.
Since $f$ is differentiable at $x_o$, $$ \exists a_o>0 \ \ \text{s.t} \ \ \forall x \in I \ \ \ \ \ 0<|x-x_o|<a_o \implies \left| \frac{f(x)-f(x_o)}{x-x_0} - f'(x_o)\right| <b$$ Let $x_1 \in (x_o,x_o+a) \forall x \in I; f(x_1) \leq f(x_o)$ $$ \left| \frac{f(x_1)-f(x_o)}{x_1-x_0} - f'(x_o)\right| <b \\ -b < f'(x_o)-\frac{f(x_1)-f(x_o)}{x_1-x_0} <b \\ f'(x_o) < b+ \frac{f(x_1)-f(x_o)}{x_1-x_0} < b$$ $$f'(x_o) < b \tag{1} $$ Similarly Let $x_2 \in (x_o-a,x_o) \forall x \in I; f(x_2) \leq f(x_o)$
$$ \left| \frac{f(x_2)-f(x_o)}{x_2-x_0} - f'(x_o)\right| <b \\ -b < \frac{f(x_2)-f(x_o)}{x_2-x_0} - f'(x_o) <b \\ -b< -b + \frac{f(x_2)-f(x_o)}{x_2-x_0} < f'(x_o)$$ $$-b<f'(x_o) \tag{2} $$
From $(1)$ and $(2)$, $$ -b < f'(x_o) <b \\ |f'(x_o)|<b $$
I'm stuck here, how can I go to $f'(x_o)=0$ from here?
Any help?