Integrable function Please help me prove this.
Suppose $f$ is defined in$\left [ a,b \right ]$ ,$f\geq 0$, $f$ is integrable in$ [a,b]$ and $\displaystyle\int_{a}^{b}fdx=0$
prove:
$\displaystyle\int_{a}^{b}f(x)^2dx=0$  
Thanks a lot!

Intuitively $f$ must be zero almost everywhere (term from Lebesgue theory). Now, if $f$ is zero almost everywhere then so is $f^2$, and then $\int f^2=0$ too.
That this is really the case is in fact trivial because $$0=\int_a^b f(x) dx =\int_a^b |f(x)|dx=\|f\|_{L^1(a,b)}$$
in other words the $L^1$-norm of $f$ is zero and then (because it is a norm) $f$ must be the $L^1$-zero function, that is $f$ must be zero almost everywhere. 
If we did not know that $f\mapsto\|f\|_{L^1(a,b)}$ is a norm, it is sufficient to prove that the set $A=\{x: \, f(x)>0\}$ has measure zero $\mu(A)=0$ (where $\mu$ is the Lebesgue measure). In order to do that we need some argument where we use $\int f = 0$ in simpler terms, one such method is to split the set into a countable number of disjoint sets that  we can control (similar to robjohn's argument). Having said that, let us consider 
$$A= \bigcup_{n=1}^\infty A_n$$
where $A_n=\{x: 1/n\le f(x) < 1/(n-1)\}$ (where in the exceptional case $n=1$ we mean $A_1=\{x : \,f(x)\ge1\}$ ).
Then since the sets are disjoint we have
$$\mu(A)=\sum_{n=1}^\infty\mu(A_n)=\sum_{n=1}^\infty\int_{A_n}1dx$$
and since $f(x)\ge 1/n$ on $A_n$ we have
$$\int_{A_n}1dx\le n\int_{A_n}f(x)dx\le n\int_a^bf(x)dx=n\cdot0=0$$
That is each $A_n$ has measure 0, and hence so has $A$.
