TITLE: Intuition for a function that belongs to a $L^p$ space
QUESTION [8 upvotes]: Does a function $f(x):[0,\infty)\rightarrow R$ with $f\in L^p$ for $p<\infty$ have to die down to $0$ as $x\rightarrow \infty$? I some how feel that the $L^p$ norm exist only when the function dies down to $0$ and the rate at which it dies down to $0$ depends on $p$. Is this right?

REPLY [2 votes]: If by “die down,” you mean “converge to $0$”, then the answer is no. Consider the following function:
\begin{align*}
f(x)\equiv
\begin{cases}
0&\text{if $x\in[0,1)$,}\\
1&\text{if $x\in[1,1+1/1^2)$,}\\
1&\text{if $x\in[2,2+1/2^2)$,}\\
0&\text{if $x\in[2+1/2^2,3)$,}\\
1&\text{if $x\in[3,3+1/3^2)$,}\\
0&\text{if $x\in[3+1/3^2,4)$,}\\
\vdots\\
1&\text{if $x\in[n,n+1/n^2)$,}\\
0&\text{if $x\in[n+1/n^2,n+1)$,}\\
\vdots
\end{cases}
\end{align*}
This function doesn't converge to zero as $x\to\infty$ (nor is it equal almost everywhere to a function that does), yet, for any $p\in[1,\infty)$:
\begin{align*}
\|f\|_p=\left(\int|f(x)|^p\,\mathrm dx\right)^{1/p}=\left(\sum_{n=1}^{\infty}\frac{1}{n^2}\right)^{1/p}=\left(\frac{\pi^2}{6}\right)^{1/p}<\infty.
\end{align*}