# Question on a proof that involves continuity

I was reading the proof here but I have a question on it.

It uses the claim that if the integral of $f^2$ over [0,1] is 0 then $f$ is 0 by continuity. I'm not sure how to show that using continuity. I can see why by playing around with a counter-example such as $f(x)=4x$. Can someone please show it to me using continuity?

A discontinuous function, such as one that fails to equal $0$ at only finitely many points in $[0,1]$ could have a square integral of $0$ without being the zero function. However, if a function is continuous, so its square is also continuous, then having a non-zero value at some point would cause the square function to have its value strictly positive at that point, and by continuity, on some neighborhood of that point. That would result in an integral greater than $0$.
More formally, suppose $f(x_0)\ne 0$, then $f^2(x_0)=a>0$. By continuity, there is some $\delta$ such that $|x-x_0|<\delta\implies f^2(x)>\frac{a}{2}$, so $\int_0^1 f^2(x)\,dx\ge a\delta>0$.
• How did you get $f^2(x) = a/2$? – user1691278 Nov 29 '17 at 5:21
• We can choose any positive $\epsilon$. I chose $\frac{a}2$, and for that $\epsilon$, there is some $\delta$. Then we have $|f^2(x)-a|<\epsilon \implies f^2(x)>\frac{a}2$. – G Tony Jacobs Nov 29 '17 at 5:32
• I see. Then how did you get that the integral is greater than $\alpha\delta$? I was doing a Riemann sum approximation to see that but I couldn't. – user1691278 Nov 29 '17 at 5:34
• Define $g(x)=\frac{a}2$ on $[x_0-\delta,x_0+\delta]$, and $0$ everywhere else. That function integrates to $a\delta$, and $f^2\ge g$. – G Tony Jacobs Nov 29 '17 at 5:36
• Certainly. If $f^2(x)=c$ for all $x$, then its integral on the interval is equal to $c$, so if that's greater than $0$, then we're done. – G Tony Jacobs Nov 29 '17 at 6:01