Suppose $\phi$ is a real function on $\mathbb{R}$ such that $$\phi \Bigl(\int_0^1f(x)\,dx\Bigr)\leq \int_0^1 \phi(f)\,dx$$ for every real bounded measurable function $f$. Prove that $\phi$ is then convex.
This one is in Rudin's Real and Complex Analysis, page 74, and, to be quite honest, I am unsure what my first step to solve this problem should even be. To help think of a general methodology, I attempted this similar question, from page 71 of the same book:
Assume $\phi$ is a continuous real valued function on $(a,b)$ such that $$\phi\Bigl(\frac{x+y}{2}\Bigr)\leq\frac{\phi(x)+\phi(y)}{2}$$ for all $x, y\in (a,b).$ Prove that $\phi$ is then convex (the conclusion does not follow if continuity is omitted from the hypothesis).
I take it that the latter question is just a special case of the former (assuming $\phi$ is bounded on $(a,b)$), so I attempted to solve the latter problem first. My attempt was to note that \begin{align*} \phi\big(\lambda x + (1-\lambda)y\big) &\leq \phi\Bigl(\frac{2\lambda x + 2(1-\lambda)y}{2}\Bigr) \\ &\leq \frac{1}{2}\Bigl(\phi\bigl(2\lambda x\bigr)+\phi \bigl(2(1-\lambda)y\bigr)\Bigr) \\ & \leq \phi\bigl(\lambda x\bigr)+\phi\bigl((1-\lambda)y\bigr) \end{align*} with the latter inequality justified simply by applying the hypothesis again twice to the previous expression.
From here, however, I am stuck; I cannot justify "popping out" the $\lambda$ and the $(1-\lambda)$ in the last inequality via some bound afforded by the hypothesis and/or the continuity of $\phi$.