Solution (source code)

= Solution

In the one-dimensional unit-mass setting, put $q=f/\gamma$. Using the convention $0\log0=0$, the <relative entropy> is
$$
H(f\mid\gamma)=\int f\log(f/\gamma)\,dv=\int\gamma\,q\log q\,dv.
$$
Because $\int\gamma q=\int f=1=\int\gamma$, we can subtract $q-1$ inside the integral:
$$
\boxed{H(f\mid\gamma)=\int\gamma(v)
[q(v)\log q(v)-q(v)+1]\,dv\geq0.}
$$
This is <relative entropy nonnegativity> from the given scalar inequality. Its integrand vanishes only at $q=1$, so \b[zero <relative entropy> characterizes $f=\gamma$ almost everywhere]. The nonnegativity remains valid with value $+\infty$ when entropy is not finite.