$\int_0^x (x-t)^2g(t)\,dt$ has a local minimum if $g(0) = 0$ and $g'(0) > 0$. Let $g:\mathbb{R} \rightarrow \mathbb{R}$ be a differentiable function
such that $g(0)=0$ and $g'(0)>0$.
Consider the function $$f(x)=\frac{1}{2}\int_0^x (x-t)^2g(t)\,dt$$
Prove that $f$ has a local minimum at $x=0$.
So far, I can find a formula of derivative of $f$ $$f'(x)=\int_0^x(x-t)g(t)\,dt$$ without using any information about $g$. How can we apply the condition about $g$ to show $f$ has a local minimum at $x=0$?

It should be clear that
$$ f'(0)=0.$$
Show that $f$ is twice differentiable and
$$f''(x)= \int_0^xg(t)dt.$$
This shows that $f'''$ exists and
$$f'''(x)=g(x).$$
Hence $f^{(4)}$ exists and $f^{(4)}(x)=g'(x).$
Then we have
$$f'(0)=f''(0)=f'''(0)=0$$
and
$$ f^{(4)}(0)=g'(0)>0.$$
