Is any continuous, Lebesgue-integrable function on $\mathbb{R}^n$ vanishes at infinity? Let $f:\mathbb R^n \to \mathbb C$ continuous such that 
$$ \int_{\mathbb{ R}^n} |f(x)|dx < + \infty $$
There is usually a claim in some Fourier Analysis lecture notes  that 
$$ |f(x)|\to 0 \textrm{ as }|x|\to \infty $$
where can I find a good proof of this statement? 
 A: This is false, let $n=1$ and consider the function
$$f(x) = \begin{cases} 8^n(x-n) && n\le x\le n+4^{-n}, && n\ge 1 \\ 
2^n+8^n(n+4^{-n}-x) && n+4^{-n}\le x\le n+2\cdot 4^{-n},  && n\ge 1 \\
0 && o/w\end{cases}$$
Perhaps you mean that $\widehat{f}(\xi)$ vanishes at infinity, which is true.
A: Let
$$ f(x) = \sum_{j=0}^\infty 2^j\operatorname{tri}(\frac{x - 2^j}{2^{2j}}), \qquad (x \in \mathbb R)
$$
$f$ is continuous. (The triangles do not touch)
Graphically, $f$ consists of increasingly tall and thin spikes of triangles whose total area is finite.
A: For $n\in \mathbb N$ let $f(x)$ be linear on $[n-2^{-n}, n]$ and linear on $[n,n+2^{-n}]$ with $f(n-2^{-n})=f(n+2^{-n})=0$ and $f(n)=2^{n/2}.$ Let $f(x)=0$ for all other $x.$ Then $$\int_0^{\infty }f(x)dx=\sum_{n=1}^{\infty}2^{-n/2}\ne \infty.$$
A: The function
$$f(x) = \left (\frac{2+\cos x}{3}\right )^{x^4}$$
is real analytic on $\mathbb R$ and satisfies $\int_\infty^\infty |f| < \infty.$ But note $f(2\pi n)= 1$ for all $n.$ I like this example, but for intuition the "triangular spike" method is probably best. 
A: If know $\Bbb R=\bigcup\limits_{n}[n,n+1)$ along with the splitting $ [n , n+1) = [n,n+\frac{1}{2^n})\cup[ n+\frac{1}{2^n},n+1)$
Then, $$\Bbb R=\bigcup\limits_{n\ge 0} \left([n,n+\frac{1}{2^n})\cup[ n+\frac{1}{2^n},n+1)\right)$$
We set the functionn $f$ (see its construction below)
\begin{equation}
f(x)= \begin{cases}
 \underbrace{-2^{2n+2}(x-n)^2+2^{n+2}(x-n)}_{P_n}& \text{if} ~~ n\le x\le n+\frac{1}{2^n} ~~\text{for some $n\in\mathbb{N}$}\\
0 &\text{ if}~~~j+\frac{1}{2^j}\le x\le j+1~~\text{for some $j\in\mathbb{N}$}\\ f(-x)& \text{if }~~x\lt  0.
\end{cases}
\end{equation}
($h =1$, $ \varepsilon_n  =\frac{1}{2^n}$, $a_n = n$ and  $b_n =n+\frac{1}{2^n}$)
One can check that $f$ is an even and continuous function. Further, we have
$$ \int_\mathbb{R} f(x)\,dx= 2\sum_{n=0}^{\infty}\int_{n}^{n+\frac{1}{2^n}} P_n(x) dx = 2\sum_{n=0}^{\infty}-4
\left[ \frac{2^{2n}}{3}(x-n)^3-\frac{2^n}{2}(x-n)^2\right]_{n}^{n+\frac{1}{2^n}}\\
= \frac43\sum_{n=0}^{\infty} \frac{1}{2^n}= \frac{8}{3} $$
Morerover, for every $n\in\mathbb{N}$ one has $$f(n) = 0~~and ~~~f(n+\frac{1}{2^{n+1}}) = 1 $$
Therefore $$\lim_{|x| \to \infty}|f(x)|\not \to 0 $$
further,  $\lim_{|x| \to \infty}|f(x)|$ does not exist.

Construction of f:
  The aim is to construct a family of polynomial $P_n: [a_n,b_n]\to \mathbb{R}$ of degree equals to 2 with $ P_n(a_n)=P_n(b_n)=0 ,P_n(\frac{a_n+b_n}{2}) = h$ such that 
  $$ \int_{a_n}^{b_n} P_n(x) dx =\alpha_n ~~~\text{with } ~~\sum_{n=0}^{\infty} \alpha_n <\infty$$
   where $b_n =a_n +\varepsilon_n $, $\varepsilon_n\to 0$, the sequence $(a_n)$ is increasing and the family $([a_n,b_n])_n$ is pairwise disjoint.

First step
$P_n(x) = c(x-a_n)(x-b_n) =  c(x-a_n)^2-c\varepsilon_n(x-a_n) ~~$ $c\in \mathbb{R}$
and 
$P_n(\frac{a_n+b_n}{2}) = h$ entails $-c\left(\frac{a_n-b_n}{2}\right)^2= h$
that is $c= -\frac{4h}{\varepsilon^2_n}.$
Second Step
\begin{split}
\int_{a_n}^{b_n} P_n(x) dx &=&-\frac{4h}{\varepsilon^2_n} 
\left[ \frac{1}{3}(x-a_n)^3-\frac{\varepsilon_n}{2}(x-a_n)^2\right]_{a_n}^{b_n =a_n+\varepsilon_n}\\
&=& \frac{2h\varepsilon_n}{3} = \alpha_n
\end{split}
Therefore 
$$ \sum_{n=0}^{\infty} \alpha_n <\infty\Longleftrightarrow\sum_{n=0}^{\infty} \varepsilon_n <\infty.$$
Whence we chose 
$a_n= n,2^n,.... $ and $\varepsilon_n = \frac{1}{n^s}, \frac{1}{n!},\frac{1}{2^n},\frac{1}{3^n}...$ 
for simplicity $a_n= n$ and $\varepsilon_n = \frac{1}{2^n}$ 
so that 
$$P_n(x) = -\frac{4h}{\varepsilon^2_n}(x-n)^2+\frac{4h}{\varepsilon_n}(x-n)$$
Last step
One can easily check that the family of intervals $([n,n+\frac{1}{2^n}])_n$ is pairwise disjoint
We then define the function 
\begin{equation}
f(x)= \begin{cases}
 \underbrace{-\frac{4h}{\varepsilon^2_n}(x-n)^2+\frac{4h}{\varepsilon_n}(x-n)}_{P_n}& \text{if} ~~ n\le x\le n+\frac{1}{2^n} ~~\text{for some $n\in\mathbb{N}$}\\
0 &\text{ if}~~~j+\frac{1}{2^j}\le x\le j+1~~\text{for some $j\in\mathbb{N}$}\\ f(-x)& \text{if }~~x\lt  0.
\end{cases}
\end{equation}
We can check that $f$ even, continuous and we have
$$ \int_\mathbb{R} f(x)\,dx= 2\sum_{n=0}^{\infty}\int_{a_n}^{b_n} P_n(x) dx = 2\sum_{n=0}^{\infty} \frac{2h}{2^n3} = \frac{8h}{3} $$
Morerover, for every $n\in\mathbb{N}$ one has $f(n) = 0$ and $f(n+\frac{1}{2^{n+1}}) = h $
thus $$\lim_{|x| \to \infty}|f(x)|\not \to 0 $$
further,  $\lim_{|x| \to \infty}|f(x)|$ does not exist.
