Proving the inequality $\int_X f\ln f d\mu-\int_X f d\mu\ln \int_X f d\mu\ge \int_X f\ln g d\mu-\int_X f d\mu\ln \int_X g d\mu$ Let $f,g$ be positive integrable functions on the measure space $(X, \mathcal A, \mu )$. Such that $fln f $ and  $fln g $ are also integrable 

$$\int_X f\ln f d\mu-\left(\int_X f d\mu\right)\ln\left( \int_X  f d\mu\right)\ge \int_X f\ln g d\mu-\left(\int_X f d\mu\right)\ln \left(\int_X g d\mu\right)$$
   And Prove that the equality holds true only if for some constant $c$, we have $f=cg~~~\mu-a.e$. 

It looks there is some convex inequality behind this inequality but I don't know which one. 
Any hint or help?  
 A: Let $h=\frac g {\int g} d\mu$, $\phi (x)=x \ln (x)$ for $x>0$ and $\nu =hd\mu$. Note that $\nu$ is a probability measure. $\phi$ is convex on $(0,\infty)$ since $\phi ''(x)=\frac 1 x >0$. Hence $\phi (\int \frac f g  d\nu) \leq \int \phi \circ \frac f g d\nu$. Simplifying this gives the required inequality. (It may be advisable to look at the case $\int g d\mu =1$ first).
A: Here is an alternative to this question
First suppose that $\|f\|_1=\|g\|_1 =1$ otherwise replaces $f$ by $f'=\frac{f}{\|f\|_1}$ and $g$ by $g' =\frac{g}{\|g\|_1}$
On other hands it is well known that for all $x>0$ the following inequality holds true 
$$\ln x\le x-1$$
one can obviously check that the equality holds true in thisd inequality iff $x=1$. Namely $x=1$ is the only solution to the equation $\ln x=x-1. $ 
However replacing $x$ by $f/g$ leads to  the following 
$$f\ln f- f\ln g\le g-f$$
integrating both we get 
$$\int_X f\ln fd\mu- \int_X f\ln g d\mu\le \int_X gd\mu-\int_X fd\mu =1-1=0. $$
that is,  $$\int_X f\ln fd\mu\le \int_X f\ln g d\mu $$ and equality holds if and only if $f=g$ a.e which end the proof. 
