Thank you Zardoz for your solution.
Here is another one.
Solution
Since \(\displaystyle{P(X\in I)=1}\), we have that \(\displaystyle{\mu=E(X)\in I}\).
The function \(\displaystyle{f}\) is convex, so it has a straight line at \(\displaystyle{x=\mu}\), that is,
there exists \(\displaystyle{u\in\mathbb{R}}\) such that \(\displaystyle{f(x)\geq f(\mu)+u\,(x\mu)\,,\forall\,x\in I}\) .
Therefore, \(\displaystyle{f(X)\geq f(\mu)+u\,(X\mu)}\) and
\(\displaystyle{E(f(X))\geq f(\mu)+u\,(E(X)\mu)=f(\mu)=f(E(X))}\) .
