Prove that $f$ is convex if and only if $f\left(\frac{a+b}{2}\right)\leq \frac{1}{b-a}\int_a^b f(x) dx$

153 Views Asked by At

Prove $f:\mathbb{R} \to \mathbb{R}$ is convex if and only if $f\left(\frac{a+b}{2}\right)\leq \frac{1}{b-a}\int_a^b f(x) dx$ for any $a,b \in \mathbb{R}$.

The context of this result is proving that in $\mathbb{R}$, a function is $C^0$-subharmonic if and only if it is convex. We have a few equivalent definitions of $C^0$-subharmonic but I thought the above would be the most logical to try to prove. But I'm not sure how to prove either direction. One can interpret the RHS as the average value of $f$ on $[a,b]$ and then the forward direction is at least visually clear, but I don't know how to express this mathematically. Help/hints would be appreciated.