Restriction of $f$ to $B(x_0,\delta)$ attains a maximum Let $f: U\to \mathbb{R}$ $U\in \mathbb{R}$ be twice differentiable at $x_0\in U$. If $f'(x_0)=0$ and $f''(x_0)<0$ then the restriction of $f$ to $B(x_0,\delta)$ attains a maximum at $x_0.$
I know that by defintion $$\lim_{x\to x_0} =\frac{f'(x)-f'(x_0)}{x-x_0} = f''(x_0)<0$$ and since $f$ is differentiable at $x_0$ then it is also continuous at $x_0.$ How can I prove this question?

Taylor's theorem gives $f(x) = f(x_0) + f'(x_0) (x-x_0) + { 1 \over 2} f''(x_0) (x-x_0)^2+ r_2(x-x_0)$, where $\lim_{h \to 0} { r_2(h) \over |h|^2 } = 0$. Choose $\delta>0$ small enough so that if $|x-x_0| < \delta$, then ${ r_2(x-x_0) \over |x-x_0|^2 } < -{ 1 \over 4} f''(x_0) $.
Since $f'(x_0) = 0$, if $|x-x_0| < \delta$ we have
$f(x) \le  f(x_0) + { 1 \over 4} f''(x_0) (x-x_0)^2$, from which it follows that $x_0$ is a strict maximizer of $f$ on $B(x_0,\delta)$.
