Showing that a real function is convex 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.
 A: 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.
A: I assume that $\varphi:[0,1]\to\mathbb R$.
Definition of convex is: For each $\alpha\in[0,1]$ and for each $x$, $y$ the inequality
$$\varphi(\alpha x+(1-\alpha)y) \le \alpha \varphi(x) + (1-\alpha) \varphi(y).$$
Try to use the following measure:
$$\mu(A) = \alpha \chi_{\{x\}}(A) + (1-\alpha) \chi_{\{y\}}(A)$$
and the function $f(x)=x$.
Here $\chi_B$ denotes the characteristic function of the set $B$ (a.k.a. indicator function). The measure $\mu$ is basically a convex combination of two Dirac measures $\delta_x$ and $\delta_y$, i.e.
$$\mu(A)=\alpha \delta_x(A)+ (1-\alpha) \delta_y (A).$$
To prove that this implies convexity it suffices to show that for any function $g$ we have
$$\int g \mathrm{d}\mu = \alpha g(x) + (1-\alpha) g(y).$$

EDIT: I understood the question as follows: Suppose that Jensen's inequality holds for arbitrary measure and arbitray $\varphi$, $f$. Then prove convexity. Srivatsan's answer is better, since he only uses the usual (Lebesgue) measure - which was probably the original intention of the question. (Although I have a simpler function $f$...)
