Let $f:[0,1]\rightarrow [0,\infty)$ be in $L^1([0,1])$ such that for every measurable set $E\subset [0,1]$ $$ \int_E f\leq \sqrt[2]{m(E)}$$ where $m$ is the Lebesgue measure on $\mathbb{R}$.
a) Show $f\in L^p([0,1])$ for all $p\in[1,2)$
b) Provide an example to show that a) fails when $p=2$
I've just started learning about $L^p$ spaces and am wondering if part a) requires some more advances knowledge. At this point, I have no idea how to even start part a). I did find that the function $f(x)=\frac{1}{2\sqrt{x}}$ with $f(0):=0$, gives a counterexample for when $p=2$. Help and/or hints for part a) would much appreciated !
Let $S_c$ be the set $S_c= \{x | f(x) > c \}$. Note that $\int_{S_c} f \geq cm(S_c)$. We then have, by the hypothesis, that $\sqrt{m(S_c)} \geq cm(S_c)$, which implies that $m(S_c) \leq \frac{1}{c^2}$. Similarly, note that $\{ x | (f(x))^p > c\} = S_{c^{1/p}}$, hence $m(\{ x | (f(x))^p > c\}) \leq c^{-2/p}$.
Finally, note that $\int_{S_1} f^p = \int_1^\infty m(f^p > c) dc \leq \int_1^\infty c^{-2/p} dc$, which makes sense when $p<2$, but for $p=2$ will give a contradiction, as the function $(4x)^{-0.5}$ shows.