Let $E$ be a measurable set with $m(E)>0$.
Let $f$, $\gamma$ be two measurable, real-valued function which are finite a.e. on $E$ with $f, \gamma$ and $f\cdot \gamma$ all integrable.
Assume $\gamma\geq 0$ and $\int_{E}\gamma>0$. Then if $\phi$ is a convex function on an open interval $(a,b)$ containing the range of $f$, then we have
$\phi\Big(\dfrac{\int_{E}f\cdot\gamma}{\int_{E}\gamma}\Big)\leq\Big(\dfrac{\int_{E}\phi(f)\cdot\gamma}{\int_{E}\gamma}\Big)$
I am trying to modify the proof of the simpler version (the one with only $f$) of Jensen's inequality to this more general version, but I don't really know how to deal with the new function $\gamma$.
Any hints or detailed explanations are really appreciated!!
${\bf Edit\ 1:}$
I got some but still limited development.
To make things simpler, I assume $\phi$ has $1^{st}$ derivative, and assume $\int_{E}\gamma=1$
As $\phi$ is convex, for each $a$, we have $\phi(y)>(y-a)\phi'(a)+\phi(a)$
so in particular, as $\gamma\geq 0$, we have
$\int \phi\big(f(x)\big)\cdot\gamma(x)dx\geq\int\big[(f(x)-a)\phi'(a)+\phi(a)\big]\gamma(x)dx=\int \big(f(x)-a\big)\gamma(x)dx\times \phi'(a)+\phi(a)$
Now, let $a=\int f(x)\cdot\gamma(x)dx$, we will have $\int \big(f(x)-a\big)\gamma(x)dx=0$ and we are done in this simple case.
In a general case, a convex function on the real line has only right derivative, and thus we have $\phi(y)>(y-a)\lim_{h\rightarrow 0^{+}}\dfrac{\phi(a+h)-\phi(a)}{h}+\phi(a)$, so with the complicated notation, our proof is still okay.
However, how do I expand this case to the case where $\int_{E}\gamma$ is not 1?
$\textbf{My Completed Proof:}$
Okay, I think I proved it.
To make things simpler, let $\int_{E}\gamma=b\geq 0$ and suppose $\phi(x)$ has the first derivative.
As $\phi$ is convex, for each $a$, we have $$\phi(y)>(y-a)\phi'(a)+\phi(a)$$
So in particular, as $\gamma\geq 0$, we have:
$\dfrac{\int_{E}\phi(f(x))\gamma(x)dx}{b}\geq\dfrac{\int_{E} [(f(x)-a)\phi'(a)+\phi(a)]\gamma(x)dx}{b}=\dfrac{\phi'(a)}{b}\int_{E}f(x)\gamma(x)dx-a\phi'(a)+\phi(a)$
Now, let $a=\dfrac{\int_{E}f(x)\gamma(x)dx}{b}$, the first two summands of the above equation will be killed, and we get what we want.
So in general case, convex function has only right derivatives, so we have $$\phi(y)>(y-a)\lim_{h\rightarrow 0^{+}}\dfrac{\phi(a+h)-\phi(a)}{h}+\phi(a)$$
By letting $F(a)=\lim_{h\rightarrow 0^{+}}\dfrac{\phi(a+h)-\phi(a)}{h}$ our proof is still valid, since $F(a)$ will be killed in the end as what happened to $\phi'(x)$, then we are done.
Is my proof okay here? Feel free to point out my mistake or better proof!
Thank you!
Most of the answer is in my post, $\textbf{ My Completed Proof}$ part. Only three minor points need to be added.
Firstly, in the third line of my proof, we need to comment that $a$ in is the domain of $\phi$.
Secondly, in the sixth line, we need to note that $\phi(f(x))$ makes sense since by hypothesis, the domain of $\phi$ contains the range of $f(x)$.
Finally, $a=\dfrac{\int_{E}f(x)\gamma(x)dx}{b}$ makes sense because $\gamma\geq 0$, so we can enlarge or reduce $f$ to its max or min so that $a$ is in the range of $f(x)$.
With all those details added, the proof in my post is complete.