I want to show the Schwarz inequality,
$$
\left(\int_Qfg\right)^2\le\int_Qf^2\int_Qg^2,
$$
for Riemann-integrable functions $f:Q\subset\mathbb{R}^n\to\mathbb{R}$, where $Q$ is a rectangle.
But in the case where $\int_Qf^2 = 0$ I'm not seeing how to get $\int_Qfg=0$ from it. I have seen this question but I don't know what norm they're using and really didn't understand the inequality proposed in the first answer.
Best Answer
Some notation: for any function $\phi:Q \to \Bbb{R}$, let's define the set $Z_{\phi} := \{x \in Q| \, \phi(x) \neq 0\}$. Here is a definition, and a few theorems:
Now, we have two theorems
If I recall correctly, in Analysis on Manifolds, Munkres gives a pretty nice and quick proof of these facts using the equivalent characterization of Riemann-integrability (a bounded function on a rectangle is Riemann-integrable if and only if the set of discontinuities has measure zero)
Now, for your actual question. Suppose $\int_Q f^2 = 0$. Since $f^2$ is a non-negative, Riemann integrable function whose integral vanishes, theorem $2$ implies that set $Z_{f^2}$ has measure zero. Next, it is easily verified that $ Z_{fg} \subset Z_f = Z_{f^2}$; hence $Z_{fg}$ has measure zero. By theorem $1$, it follows that \begin{align} \int_Q fg &= 0. \end{align} Hence, we have an equality in the Cauchy-Schwarz inequality.
Edit:
Having taken a look at the answer in the link, I realized the issue is much simpler. It all boils down to the following simple lemma:
Note that if $a \neq 0$, this follows by a simple application of completeing the square: write $p(x) = a\left( x + \frac{b}{2a}\right)^2 - \frac{b^2 - 4ac}{4a}$, and from here, manipulate inequalities (there's like a few cases, but they're all easy to prove).
If $a = 0$, then we have $p(x) = bx + c$; but if $p(x)$ maintains a constant sign, then we must have $b=0$ (simply sketch the graph of $p(x)$ with $b \neq 0$ to convince yourself). Since $b=0$, and $a=0$, we of course have $b^2 - 4ac = 0 \leq 0$.
Now, we apply this simple lemma to our present situation. Consider the following polynomial in $\lambda$: \begin{align} p(\lambda) := \int_Q (\lambda f- g)^2 = \left(\int_Q f^2\right) \lambda^2 + \left(-2 \int_Q fg\right) \lambda + \int_Q g^2 \end{align} Since $p(\lambda)$ was obtained by integrating a non-negative function, we clearly have that for every $\lambda \in \Bbb{R}$, we have $p(\lambda) \geq 0$. Now, identify what $a,b,c$ are, and then you immediately find that $b^2 - 4 ac \leq 0$ implies the Cauchy-Schwarz inequality.
Finally, of course, if you wish to find out what the equality cases are, simply trace through the derivation above, and see when we can replace the $\leq$ with $=$. This I leave to you $\ddot{\smile}$.