$f,g$ are monotonically increasing in $[0,1]$ and $0\le f , g \le 1$. $\int_0^1 f - g \mathrm{d}x = 0$. Prove that
$$\int_0^1 |f - g|\mathrm{d}x \le \frac{1}{2}$$
In my previous question, $g(x) = x$. And my teacher said $x$ can be replaced by $g(x)$. In fact, in previous question, we don't need to use the condition $\int_0^1 f - g \mathrm{d}x = 0 $. But if we replace $x$ with $g$, this condition becomes necessary.
Also, if $g = x$, we can replace the $\frac{1}{2}$ with $\frac{1}{4}$,that is
$$\int_0^1|f-g| \mathrm{d}x \le \frac{1}{4}$$ I am wondering how to prove that.