Let $f\in W^{2, p}(I)$ where $I\subset \mathbb{R}$ is an interval, $p\geq 1$.
1)Suppose that $\operatorname{ess. Im}(f'')\subseteq[0,+\infty)$ where $f''$ is the second weak derivative of $f$ and and $\operatorname{ess. Im}$ is the essential range (https://en.wikipedia.org/wiki/Essential_range). Does this imply that $f$ is convex?
2)If instead of considering $f\in W^{2, p}(I)$ we consider $f\in \mathcal{D}'(I)\cap C^0(I)$ a distribution such that $$\forall \varphi \in C^\infty_c(I)\ s.t. \phi\geq 0\ \Rightarrow D^2f(\varphi)\geq 0$$ Is $f$ convex?
True in both cases. Consider the second case, as the more general. A positive distribution is a positive measure. So, $f''$ (distributional derivative) is a measure, call it $\mu$. Integrate $\mu$ once; we get a function $g(x) = \mu(a,x)$ such that $f'-g$ has zero distributional derivative, hence is constant. Integrate again; $h(x) = \int_a^x g(t)\,dt$, and conclude that $f-h$ is linear, while $h$ is a convex function (its derivative is increasing).