A function vanishing at infinity which is not $L_1$ I need an example of a continuous function $f:\mathbb{R}\rightarrow  \mathbb {R}$ vanishing at infinity, i.e. $$\lim_{x\rightarrow\infty}f (x) =\lim_{x\rightarrow-\infty}f (x)=0$$  but $f$ is not $L_1$. 
 A: A somewhat cruder example, respect to the one given by saz in the comments, is the following one
$$
f(x)=
\begin{cases}
0 & |x|<1\\
|x|^{-1} & |x|\ge 1
\end{cases}.
$$
The function $f(x)$ vanishes at the infinity but, for any any $R>1$,
$$
I(R)=\int\limits_{[-R,R]}\!f(x)\,\mathrm{d}x= 2\log(R)\underset{R\to+\infty}{\longrightarrow}+\infty\iff f\notin L^1(\mathbf{R})
$$
A second example: as noted by the OP, the function $f(x)$ in the above example is not continuous. However, by slightly correcting it we can define $g(x)$ as
$$
g(x)=
\begin{cases}
|x| & |x|<1\\
|x|^{-1} & |x|\ge 1
\end{cases}.
$$
The function $g$ is continuous ($\in C^0(\mathbf{R}$)) and again, for every $R>1$, we have
$$
I^\prime(R)=\int\limits_{[-R,R]}\!g(x)\,\mathrm{d}x= 1+2\log(R)\underset{R\to+\infty}{\longrightarrow}+\infty\iff g\notin L^1(\mathbf{R}).
$$
A third example. Finally, defining $h(x)$ as
$$
h(x)=
\begin{cases}
\dfrac{1}{2}(3-x^2) & |x|<1\\
|x|^{-1} & |x|\ge 1
\end{cases}.
$$
we have $h\in C^1(\mathbf{R})$ and for every $R>1$
$$
I^{\prime\prime}(R)=\int\limits_{[-R,R]}\!h(x)\,\mathrm{d}x= \frac{8}{3}+2\log(R)\underset{R\to+\infty}{\longrightarrow}+\infty\iff h\notin L^1(\mathbf{R}).
$$
A: A continuous, although informal example, is to create a function as follows:
In the interval $[-1,1]$ behaves like this $f(x)=100-|x|$, so the integral over the interval $[-1,1]$ evaluates to 100. Now, as $x$ grows in value towards $\infty$ or $-\infty$, define additional triangles at a constant distance between one another, so that the peak of each triangle is half the height of the previous peak, and the base is twice the size of the previous base.
This way, although $\lim_{x \rightarrow \infty} f(x) = 0$, the integral itself does not evaluate to a finite value.
A: Here's an example of a smooth function with that property:
$$f(x) = \frac{1}{1+\ln(1+\cosh x)}$$
