# An example of a function not in $L^2$ but such that $\int_{E} f dm\leq \sqrt{m(E)}$ for every set $E$

Let $f\in L^1 [0,1]$ to be a nonnegative function satisfied:

$$\int_{E} f dm\leq \sqrt{m(E)}$$ for every measurable set $E\subset [0,1]$, Prove that $f\in L^{p}[0,1]$ for $1\leq p<2$.

I have already done this. But I want a counterexample for $p=2$. How to obtain one?

1. $L^p$ norms are invariant under rearrangement of the function: informally, we can move its values around, for example sorting them in decreasing order. So, it does not seem too restrictive to focus on decreasing functions.
2. If $f$is decreasing, then $\int_{E} f\, dm\leq \int_{0}^{ m(E)} f\,dm$. So we only need to consider initial intervals $[0,a]$ instead of general measurable sets.
3. The condition we need is $\int_0^a f\,dm \le \sqrt{a}$ for all $a\in [0,1]$. Looks like it's easier to state it in terms of antiderivative $F(x)=\int_0^x f\,dm$.
4. So, we want $F(x)\le \sqrt{x}$ and at the same time, make $F$ big. Hmm... how about $F(x)=\sqrt{x}$?
5. Go back to $f$, and you have your example.