Let $f:[a,b] \rightarrow \mathbb{R}$ be a two times differentiable function, that attains its maximum value at some $x_0\in (a,b).$ Prove that $f''(x_0)\leq 0.$
Attempt. By defintion, we have $\displaystyle f''(x_0)=\lim_{x \rightarrow x_0}\frac{f'(x)-f'(x_0)}{x-x_0}$, where $f'(x_0)=0$ by Fermat's theorem (since $x_0$ is an interior point of diferentiability of $f$), so: $$\displaystyle f''(x_0)=\lim_{x \rightarrow x_0^+}\frac{f'(x)}{x-x_0}.$$ It is enough to prove that for some $\delta>0$ we have that $f'(x)\leq 0$ for $x\in (x_0,x_0+\delta).$ This is the point I am stuck.
Thank you in advance for the help!
Since $f(x_0)$ is a maximum, there exists an interval $[x_0, x_0 + \delta)$ such that $f$ is less than $f(x_0)$ on it.
Then for any $c \in [x_0, x_0 + \delta)$ there exists a $\xi \in [x_0, x_0 + \delta)$ such that $$f'(\xi) = \dfrac{f(x_0 + \delta) - f(x_0)}{\delta} \leq 0.$$
Finally, by continuity of $\dfrac{f'(x)}{x-x_0}$, we have a sequence of $\xi_n$ such that $\dfrac{f'(\xi_n)}{\xi_n - x_0} \to a$, where $a \leq 0$, so the limit is $a$, which is $\leq 0$.