Prove Jensen's inequality, that is: if $f$ is convex, then $f(E[X|\mathcal{A}])\leq E([f(X)|\mathcal{A}])$
My attempt: because $f$ is convex, we can define $$f(x)=\sup_{n\in\mathbb{N}}a_nx+b_n$$ $$\{a_n\},\{b_n\}\in\mathbb{R}$$ Hence, $\forall n\in\mathbb{N} : f(x)\geq a_nx+b_n =\bar f(x)$ for a fixed $n\in\mathbb{N}$. So we obtain: $$f(E[X|\mathcal{A}])\geq a_nE[X|\mathcal{A}]+b_n=E[a_nX+b_n|\mathcal{A}]=E[\bar{f}(X)|\mathcal{A}]$$ So this must also hold for the supreme of $\bar{f}(x)$, "proving" the opposite result. Could anyone point out the mistake I am making?