# Does having positive second derivative at a point imply convexity in some neighborhood?

Suppose that I have a real valued function of a single variable $f(x)$ which is twice differentiable in some open interval $I$.

Then, I know from calculus that if $f''(x) >0$ on $I$, then $f$ is convex on $I$.

But, what I am wondering is that if I only know that $f''(x) > 0$ at a particular point $x_0$ in $I$, then can I say that $f(x)$ is locally convex at $x_0$? That is, can I find a small neighbourhood around $x_0$ in which $f$ is convex?

If this is true, does this idea that a positive second derivative at a point means local convexity generalize?

No, having $f''(x_0)>0$ does not imply that $f$ is convex in some neighborhood of $x_0$. Take the function $$g(x) = x+2x^2\sin(1/x),\quad g(0)=0$$ which, as shown here, is not increasing in any neighborhood of $0$ despite $g'(0)=1$. (It oscillates rapidly on small scales.)
Then let $f(x)=\int_0^x g(t)\,dt$. This function is twice differentiable (since $g$ is once differentiable), has $f''(0)=1>0$ but in any neighborhood of $0$, it fails to be convex because $f'$ fails to be increasing.
Of course, if you assume $f''$ is continuous, then $f''(x_0)>0$ implies $f''>0$ in some neighborhood, and convexity follows.