Solution (source code)

= Solution

The <second-derivative criterion for convexity> is
$$
\boxed{f\text{ is convex on }\mathbb R\quad\Longleftrightarrow\quad f''(x)\ge0\text{ for every }x\in\mathbb R.}
$$
The non-strict inequality is necessary and sufficient; the stronger condition $f''>0$ is sufficient for <strict convexity>.