Is this statement true for an arbitrary real function? If $\int_{a}^{b} f^2(x) = 0$ then $f(x) = 0$. Is this statement true for arbitrary real functions? If so, how to prove it?

If $\int_{a}^{b} f^2(x) = 0$ then $f(x) = 0$.

 A: No, this is not true. For example you can pick $f(x)=0$ except for a finite set of points for which you can assign arbitrary nonzero values. Then the integral of $f^2$ is still $0$. Intuitively speaking, the integral measures the area behind the graph of the function, and modifying a finite set of points of the graph does not modify the area.
A: It is false in general: take a function that equals $1$ on some point, and $0$ everywhere else.
For continuous functions it is true.
Proof: suppose $f:[a,b]\to \mathbb{R}$ is continuous and not identically zero. Let $x_0 \in [a,b]$ such that $f(x_0)\neq 0$, then $f(x_0)^2 > 0$. Since $f$ is continuous, $f^2$ is also continuous so there exists an interval with non-empty interior containing $x_0$ where $f(x)^2 > \eta$ where $\eta = f(x_0)^2/2$. Let $\ell > 0$ be the length of this interval. By breaking the interval into three pieces, and noticing that $f(x)^2\geq 0$ for all $x \in [a,b]$ one obtains that $\int_a^b f^2 \geq \ell \cdot \eta > 0$. In particular, $\int_a^b f^2 \neq 0$.
A: Your statement is true, if you change it like that
If $\int_{a}^{b} f^2(x) = 0$ then $f(x) = 0$ a.e. (a.e. = almost everywhere).
And the opposite direction holds as well ...   $\ddot\smile$
