Statement: A function $f:(a, b) \to \mathbb{R}$ with $f\in C^2$ is convex on some interval $I\subseteq (a, b)$ iff $f''(x) \geq 0 $ for all $x\in I$.
My attempt: I proved a theorem which is equivalent to the above (at least that's what I think), i.e. that a function (as described above) is convex iff its derivative is monotonically increasing.
$\Longleftarrow $ : Suppose first that $f^{\prime}$ is increasing on the interval $I .$ Let $x_{1}, x_{2}, x_{3} \in I$ with $x_{1}<x_{2}<x_{3}$ and by the mean value
theorem we find that $\dfrac{f\left(x_{2}\right)-f\left(x_{1}\right)}{x_{2}-x_{1}}=f^{\prime}(\xi)$ and $\dfrac{f\left(x_{3}\right)-f\left(x_{2}\right)}{x_{3}-x_{2}}=f^{\prime}(\eta)$ for $\xi \in\left(x_{1}, x_{2}\right)$ and $\eta \in\left(x_{2}, x_{3}\right) .$ By our initial
assumption $f^{\prime}$ increases meaning that $f^{\prime}(\eta) \leq f^{\prime}(\xi) \Longleftrightarrow \dfrac{f\left(x_{2}\right)-f\left(x_{1}\right)}{x_{2}-x_{1}} \leq \dfrac{f\left(x_{3}\right)-f\left(x_{2}\right)}{x_{3}-x_{2}}$ which is an equivalent characterisation of convexity I have already proven.
$\Longrightarrow $ : Suppose now that $f$ is convex. Let $x_{1}, x_{2}, x_{3}, x_{4} \in I$ with $x_{1}<x_{2}<x_{3}<x_{4}$ so
the convexity of $f$ implies that $\dfrac{f\left(x_{2}\right)-f\left(x_{1}\right)}{x_{2}-x_{1}} \leq \dfrac{f\left(x_{3}\right)-f\left(x_{2}\right)}{x_{3}-x_{2}} \leq \dfrac{f\left(x_{4}\right)-f\left(x_{3}\right)}{x_{4}-x_{3}}$ so when ignoring
the middle term and letting $x_{2} \rightarrow x_{1}^{+}$ and $x_{3} \rightarrow x_{4}^{-}$ we obtain $f^{\prime}\left(x_{1}\right) \leq f^{\prime}\left(x_{4}\right)$ meaning that $f^{\prime}$ increases.
Is my conclusion correct that the above theorem proves the inital theorem I wanted to prove?