Let $f:[a,b]\to\Bbb{R}$ be a $C^2$ function, then $f$ attains its maximum or minimum at $x_0\in(a,b)$ Let $f:[a,b]\to\Bbb{R}$ be a $C^2$ function. Let $x_0\in(a,b)$ such that $f'(x_0)=0.$
$(i.)$ Prove that if $f''(x_0)>0$, then $x_0$ is a local minimum of $f$
$(ii.)$ Prove that if $f''(x_0)<0$, then $x_0$ is a local maximum of $f$
I think we can use the Taylor formula but I don't know how to get a proof from it.
Taylor's Formula
Let $f:[a,b]\to\Bbb{R}$ be a $C^{n+1}$ function. Let $x_0\in(a,b)$ and $h$, sufficiently small, then
\begin{align}f(x_0+h)=\sum^{n}_{j=0}\frac{f^{(j)}(x_0)h^{j}}{j!}+\int^{1}_{0}\frac{(1-t)^n}{n!}f^{(n+1)}(x_0+th)h^{n+1} dt\end{align}
I've seen seen some proofs here that do not share the same domain or co-domain as mine. I would like to know if there are some references to this exact problem or if there are proofs, I also would appreciate. Thanks!
 A: Hint: I don't think the Taylor's formula is a good way to go. Instead, note that if $f''(x_0) > 0$, then $f'(x)$ is monotone increasing in a small interval around $x_0$ (as you can show using the fact that as $f$ is $C^2$, both $f'$ and $f''$ are continuous). Now think about the limit that defines $f'(x)$: if $f'(x)$ is monotone increasing near $x_0$ what can you say about $|f(x) - f(x_0)|$ for $x$ near $x_0$?
A: Replacing $f(x)$ with $f(x)-f(x_0)$, we can assume that $f(x_0)=0$. This is not necessary but will make some formulas shorter and clearer. To fix ideas, we suppose that $f''(x_0)>0$, as the other case is treated similarly. We claim that $x_0$ is a local minimum for $f$, which means that there exists $\delta>0$ such that 
$$\tag{1}\begin{array}{cc}
f(x_0+h)> 0, & \forall h\in (-\delta, \delta).
\end{array}$$
Writing the Taylor formula as you did, and using that $f'(x_0)=0$, we have 
$$\tag{2}
f(x_0+h)=\frac{f''(x_0)}{2} h^2 + R(h), \qquad\text{where } |R(h)|\le C |h|^3, $$ 
and $C> 0$ is some constant. Let $\delta= f''(x_0)/2C$. Since $|h|<\delta$, it holds that
$$
\frac{f''(x_0)}{2} h^2 > C|h|^3\ge -R(h), $$ 
and so the right-hand side of (2) is positive, which proves (1).
A: If $f^{\prime \prime}(x_0)>0$, we have $f^\prime(x)>0$ for $x>x_0$ close to $x_0$ and $f^\prime(x)<0$ for $x<x_0$ close to $x_0$ as we suppose $f^\prime(x_0)=0$. Consequently, $f$ is strictly positive on the right of $x_0$ and strictly negative locally on the left of $x_0$.
From that we can conclude that $x_0$ is a local minimum of $f$.
The other case is similar.
