I am able to prove $\Rightarrow$, but I am unable to prove the converse.
Recall that a function is called convex on $E$ (which is a subset of a linear space) if for every $x,y\in E$ and every $\lambda\in [0,1]$, we have $f(\lambda x+(1-\lambda)y)\leq \lambda f(x)+(1-\lambda)f(y)$. Prove that if a function is twice differentiable, then it is convex if and only if $f''(x)\geq 0.$
For $\Longleftarrow$, take the contrapositive: $f$ is not convex $\implies$ $f''$ is negative somewhere.
If $f$ is non-convex, there is some $x,y\in\Bbb R$ with $x<y$ and some $\lambda\in[0,1]$ such that $$ f(\lambda x+(1-\lambda)y)>\lambda f(x)+(1-\lambda)f(y) $$ Let $c=\lambda x+(1-\lambda)y$.
Because $f(c)$ lies strictly above the line between $(x,f(x))$ and $(y,f(y))$, by the mean value theorem, there is some $c_1\in[x,c]$ such that $f'(c_1)>\frac{f(y)-f(x)}{y-x}$, and there is some $c_2\in[c,y]$ such that $f'(c_1)<\frac{f(y)-f(x)}{y-x}$. Now what does the mean value theorem say exists in $[c_1,c_2]$?