TITLE: Showing that a real function is convex
QUESTION [6 upvotes]: How can I show that if $\varphi$ is a real function such that $$\varphi \left(\int_0^1 f\right)\leqslant \int_0^1 \varphi (f)$$ 
for any Borel-measurable real function $f$, then $\varphi$ is convex. 
Ps: I realize homework questions have to be tagged as such. This isn't a homework problem. I came across this question in a text book, and I thought it was interesting.

REPLY [4 votes]: You can verify the definition of convexity directly by taking a suitable $f$. Given $x_1, x_2 \in \mathbb R$ and $t \in [0,1]$, we apply the hypothesis to the step function $f : [0,1] \to \mathbb R$ given by
$$
f(s) = \begin{cases}
x_1, &0 \leqslant s \leqslant t,
\\ x_2, &t \lt s \leqslant 1.
\end{cases}
$$
This gives us
$$
\varphi\left(\int_0^t x_1 ds + \int_t^1 x_2 ds \right) \leqslant \int_0^t  \varphi(x_1) ds + \int_t^1 \varphi(x_2) ds
$$
$$
\implies \quad\varphi(tx_1 + (1-t)x_2) \leqslant t \ \varphi(x_1) + (1-t) \ \varphi(x_2),
$$
which is what we want to prove.