# Cauchy Schwarz Inequality Integral

I've tried to do the following problem without success. Spivak Chapter 13 Question 39: Suppose that f and g are integrable on $[a,b]$. The Cauchy-Schwarz Inequality states that: $$\bigg(\int_a^b fg \bigg)^2\leq \bigg(\int_a^b f^2 \bigg)\bigg(\int_a^b g^2 \bigg)$$ C) If equality holds, is it necessarily true that $f=\lambda g$ for some $\lambda$? What if $f$ and $g$ are continuous?

d)Prove that $\bigg(\int_0^1 f \bigg)^2\leq \bigg(\int_0^1 f^2 \bigg)$. Is this result true if $0$ and $1$ are replaced by $a$ and $b$?

What I did:

For the first item, I had shown that if it doesn't exist such $\lambda$ then the equality held by writing $(f-\lambda g)^2>0$ and using that the delta would be less than zero. So, I would say it is necessarily true, but the question of the functions' continuity threw me off and I'm not so sure.

For the second one, intuitively I know that the LHS can be less given that $f$ could be negative and in such case, the $f^2$ would "win", but I don't know how to go with that idea if it's the correct one. The second part also made me hesitant, but I would say that yes, it would still be true.

For question $1$, the point is that you were able to prove $$\int_a^b (f(x)-\lambda g(x))^2dx=0$$ for some lambda, but if the function inside the brackets is not continuous then it might be non-zero on some null-set. With continuity you avoid that phenomenon and the function has to be zero everywhere.
For question $2$ you can apply question $1$ with $g\equiv1$ (a constant function). This argument holds only if the interval has length $1$ though.
You can see that a counter-example when the interval doesn't have length $1$ is given by $f\equiv 1$ on the interval $[0,2]$: $$\left(\int_0^2 1dx\right)^2=2^2=4$$ whereas $$\int_0^2 1^2dx=2$$