By definition, saying that $f$ is a convex function means
$$f(t x_1 + (1-t) x_2) \leq t f(x_1) + (1-t) f(x_2)$$
where $t \in [0,1]$. How can I prove that
$$f(tx_1+(1-t)x_2) \leq tf(x_1) + (1-t)f(x_2)$$
if and only if $f''(x) \geq 0$, assuming that the second derivative of $f$ exists?