This question caught my eye from "How to integrate it" by Sean M. Stewart. I have attempted it for fun and am now stuck.
Question
Let $f$ and $g$ be continuous bounded functions on some interval $[a,b]$ such that $\int_a^b|f(x)-g(x)|dx=0$. Show that $\int_a^b|f(x)-g(x)|^2dx=0$.
Attempt
Note: $0\le |\int_a^bf(x)-g(x)dx |\le\int_a^b|f(x)-g(x)|dx=0$
We conclude $|\int_a^bf(x)-g(x)dx |=0$
Multiply both sides by $|\int_a^bf(x)-g(x)dx |$ giving $|\int_a^bf(x)-g(x)dx |^2=0$
This is where I'm stuck. Specifically how do I get both the square and the modulus back past the pesky $\int dx$
Possibly $|\left(\int_a^bf(x)-g(x)dx\right)^2|=0$ leading to $0=|\left(\int_a^bf(x)-g(x)dx\right)^2|\le?$
I feel I'm missing something with obvious with modulus but it is escaping me. Of course I could be on the wrong track altogether.
Side question: the afore mention book only has solutions to selected problems so if anyone knew of a full solution set somewhere that'd greatly help.
Thanks in advance for your help.
update
I now realise I had discarded $f(x)=g(x)$ because I thinking was thinking (incorrectly) of $\int_a^b f(x)-g(x)dx=0$ whereby I imagined a situation such as $f(x)=-x$ and $g(x)=x$ over an interval such as $[-1,1]$ I have accepted the answer that includes the case for discontinuous functions but appreciate all other efforts.
Are you sure that the condition is for $f$ and $g$ to be continuous? In that case, if $f$ and $g$ differ at one point $x_0$, then $f-g$ has the same sign and $|f-g| > \epsilon > 0 $ in some small interval around $x_0$, so the integral can't be zero. In other words, under that condition we get the much better result that $f=g$ in $[a,b]$.
Not assuming contiuity, we get have that $|f| < M$ and $|g| < N$ for some constants $M,N$ (in $[a,b]$), so we have $|f-g| < M+N$ in that interval. This leads to $\int_a^b |f(x)-g(x)|^2dx = \int_a^b |f(x)-g(x)| \times |f(x)-g(x)|dx \le \int_a^b |f(x)-g(x)|(M+N)dx = (M+N)\int_a^b |f(x)-g(x)|dx = 0.$