Squaring a Riemann integrable function bounds the integral

real-analysisriemann-integration

Let $f:\left[0,1\right]\rightarrow\mathbb{R}$ be Riemann integrable with $\int_{0}^{1}f=0$.
Prove or disprove that
if $-1\le f\le2$, then $\int_{0}^{1}f^2\le2$.

As I was going through some old notes on Riemann integration, I came across this exercise that I hadn't answered. My only two notes on the problem were the following :

  1. Since $f$ is bounded and Riemann integrable, $f^2$ must also be Riemann integrable. (See links: Proof that if $f$ is integrable then also $f^2$ is integrable and Prove that if $f$ is Riemann integrable on $[a,b]$ then so is $f^2$)

  2. Since $f^2$ is integrable, $(\frac{1}{1-0})\int_{0}^{1}f^2\le sup\{f^2\left(t\right):t \in\left[0,1\right]\}=4$ by the Mean Value Inequality for Riemann integrals. (I got $4$ as the supremum given that $f\le2$ and $2^2=4$ . I'm not sure if it's correct, however.)

I don't know where to proceed from here. Intuitively, it seems that the inequality should fail, but in trying to construct a counterexample using linear functions, it seems to hold. Furthermore, when I try to apply the formal definition of a Riemann integral for insight, I get mixed around with the summations and can't visualize a way to prove the inequality. I figure a proof by contradiction is probably the right direction, although I'm not certain.

Any help would be greatly appreciated.

Best Answer

Hint: The given restriction $-1\le f\le2$ can be written as $(f+1)(f-2) \le 0$, or $$ f^2 \le 2 + f \, . $$