Example of a square-integrable function that is not almost surely bounded

Almost sure boundedness is a strong condition which implies the finiteness of moment at any order. Now let $$f:\mathbb R \to \mathbb R$$ be square-integrable (w.r.t. Lebesgue measure), i.e., $$\int f^2(x) \mathrm d x < \infty$$. Could you provide an example of such $$f$$ that is not almost surely bounded (w.r.t. Lebesgue measure)?

• $f(x)=\frac{1}{x^{1/4}}\boldsymbol 1_{(0,1]}(x)$.
– Surb
May 10, 2022 at 16:16
• @Surb Could you transfer your comment to an answer so that i can accept it? May 10, 2022 at 16:18
• Ah!! Surb beat me to it.. I was typing my answer lol May 10, 2022 at 16:19

$$\frac{1}{\sqrt{x}}$$ in $$(0,1)$$ with the Lebesgue measure is a classic example in showing that $$L^{1}$$ need not be a subset of $$L^{\infty}$$ . (in fact $$L^{1}$$ need not be a subset of $$L^{p}$$ for any $$p>1$$.
So just take the square root (i.e. $$\frac{1}{x^{\frac{1}{4}}})$$ and you'll get an $$L^{2}$$ function that is not $$L^{\infty}$$