TITLE: Do integrable functions vanish at infinity?
QUESTION [13 upvotes]: If $f$ is a real-valued function that is integrable over $\mathbb{R}$, does it imply that
$$f(x) \to 0 \text{ as } |x| \to \infty?  $$
When I consider, for simplicity, positive function $f$ which is integrable, it seems to me that the finiteness of the "the area under the curve" over the whole line implies that $f$ must decay eventually. But is it true for general integrable functions?

REPLY [4 votes]: There are already good answers, I only wanted to make it more visual. Observe that
\begin{align}
\infty &< \sum_{k=0}^{\infty} k\ \cdot\ \ \ 2^{-k}\ \ =\hspace{10pt}2 < \infty \\
\infty &< \sum_{k=0}^{\infty} k\cdot(-2)^{-k} =-\frac{2}{9} < \infty
\end{align}
(it's easy enough to do by hand, but if you want, here and here are links to WolframAlpha).
Thus, we can use:
$$
f(x) = \sum_{k = 0}^{\infty}k\cdot(-1)^k \cdot \max(0,1-2^k\cdot|x-k|)
$$
Below are diagrams for $|f|$ and $f$:

I hope this helps $\ddot\smile$