Prove that if $f$ is a non-negative function that vanishes outside a bounded interval, then $\int_{\mathbb{R}}f^{2}d \lambda < \infty \Rightarrow \int_{\mathbb{R}}f d \lambda < \infty$

Attempt:

Since $f$ vanishes outside of a bounded interval, we only need to consider bounded intervals. $\int_{\mathbb{R}}f^{2}d \lambda = \int f^{2} \chi_{[a,b]}d \lambda$. By definition of the Lebesgue integral we can rewrite this as $\int f^{2 +}\chi_{[a,b]}d \lambda – \int f^{2 -}\chi_{[a,b]}d \lambda$ where $f^{+}(x) = \max\{f(x),0\}$ and $f^{-}(x)=\max\{-f(x),0\}$.

Evaluating the above, I get $(b-a)\max\{f^{2}(x),0\} -(b-a)\max\{-f^{2}(x),0\}$. Now I am not really sure how to proceed (or if I am on the right track?).

EDIT (After Steven's suggestion)： Let $A=\{x:|f(x)| \leq 1\} B=\{x:|f(x)|>1\}$. Then $\int_{\mathbb{R}}f d \lambda = \int_{A}f d \lambda + \int_{B}f d \lambda$. Perhaps I then split this into positive and negative parts and try to somehow use the condition on $f^{2}$?

## Best Answer

Given $f$ vanishes outside a bounded interval $A$.

Now using C-S inequality:

$$\int_A f \cdot 1 \, d\lambda \leqslant \left( \int_A f^2 \, d\lambda \right)\left( \int_A \, d\mu \right) = \lambda(A) \int_A f^2 \, d\lambda$$

$$<\infty$$

Here $\lambda(A)=\ell(A)< \infty$ as $A$ is bounded interval and $\int_{A}f^2 d\lambda<\infty$

Hence $f\in L^1(A) $ and $f=0 $ on $\Bbb{R}\setminus A$.

Hence $f\in L^1(\Bbb{R}) $ i.e $\int_{\Bbb{R}}fd\lambda<\infty$