Follow-up question to Cauchy-Schwarz for integrals.
Here's the basic idea: over the vector space of real-valued square-integrable functions defined on a subset $A \subset \mathbb{R}$, define the inner product $$\langle f, g \rangle = \int_{A}fg\text{.}$$ I am almost finished proving this, but the only property I don't know how to prove is $$\langle f, f \rangle = 0 \Longleftrightarrow f(x) = 0 \text{ } \forall x \in A\text{.}$$ Obviously, "$\Longleftarrow$" is trivial, but "$\Longrightarrow$" isn't as much. This gives us $$\int_{A}f^2 = 0$$ and we wish to show $f(x) = 0\text{ } \forall x \in A$ from this. Intuitively, this seems to make sense since $f^2$ is $\geq 0$, so we have that its integral over $A$ must be $\geq 0$ as well. But I'm not sure how to show this. It has been at least 3 years since I've last touched analysis with integrals.
By the way, I'm surprised I didn't find this question in a search. I imagine it would've been asked already.
It seems that people here are jumping on the absence of continuity of $f$. Strictly speaking if $f$ was a function, then they are completely right. However, an element $f \in L^2(A)$ is not actually a function, but an equivalence class of functions such that $f$ and $g$ are considered equivalent when $f(x) = g(x)$ for almost all $x \in A$. (That is they disagree on a measure zero set.)
Without this equivalence, $L^2(A)$ is not a Hilbert space, because otherwise there will be nonzero functions that have norm zero. The equivalence relation collects all such functions together, so that $L^2(A)$ can be considered a proper Hilbert space of (equivalence classes of) functions.
What we need to show is that if $\int_A f(x)^2 dx$ is zero, then $f(x)$ is zero almost everywhere.
For example, the function $$f(x) = \left\{ \begin{array}{cc} 1 & x \in \mathbb{Q}\\ 0 & x \in \mathbb{R}\setminus\mathbb{Q}\end{array}\right.$$ is zero almost everywhere ( $m(\mathbb{Q})=0$ with $m$ being Lebesgue measure) and satisfies $\int_{\mathbb{R}} f(x)^2 dx = 0.$
Now let us suppose that $\int_A f^2 = 0$, but $f \neq 0$ almost everywhere. Thus there is some $N$ and set $B \subset A$ such that $|f(x)| > 1/N$ when $x \in B$ and $m(B) > 0$.
Thus $$\int_A f^2 > \int_B f^2 > \int_B 1/N^2 = \frac{m(B)}{N^2} > 0,$$ which contradicts $\int_A f^2 =0$. Thus $f$ must be equal to zero almost everywhere, and thus $f = 0$ as per our equivalence relation.