Bounding the integral over a set by square root of its measure

While studying for an upcoming qualifying exam, I have been attempting to solve questions from previous exams. One question has been bothering me for some time now.

Let $f:\mathbb R\to\mathbb R$ be a measurable function such that for some $C>0$ $$m(\{x:|f(x)|\geq\lambda\})\leq C\lambda^{-2},\ \ \text{for all \lambda>0.}$$ Prove that there is some $C'>0$ such that $$\int_E|f(x)|\ dx\leq C'\sqrt{m(E)}, \ \ \text{for all measurable E\subset\mathbb R.}$$

If I can show that $f\in L^2(\mathbb R)$, then a relatively easy argument involving Jensen's inequality can establish the desired inequality with $C'=\|f\|_2$. But I am unable to show that $f\in L^2(\mathbb R)$ (and I'm not very confident that the hypotheses prove this), and have not found a good alternative approach.

Any advice as to how I should proceed would be greatly appreciated.

Recall the following formula for the integral of a function: $$\int_E |f(x)|\, dx = \int_0^\infty m\{ x\in E: |f(x)|>\lambda\}\, d\lambda.$$ Now split the last integral into two integrals $\int_0^t$ and $\int_t^\infty$ for $t$ to be determined. Bound the first by $tm(E)$ and the second by $C/t$ and then find the $t$ that minimizes the upper bound.
To see that your hypotheses do not imply $f\in L^2(\mathbb{R})$ (or even $f\in L^2_{loc}(\mathbb{R})$) consider $f(x)=|x|^{-1/2}$.