I'm not sure why this statement about functions is false? I ran into this question looking at "obvious theorems that are false". 
Link: https://math.stackexchange.com/a/827393
Someone gave the example of 
If you have a continuous function  $$f:\mathbb{R} \rightarrow [0,\infty)\, \text{ such that } \int_{-\infty}^\infty f(x)\,dx < \infty, \text{ then } \lim_{x \to \pm \infty}f(x)=0$$
I am having trouble understanding why this is false. If you have a function that is strictly non negative than wouldn't the only possible way of having an integral that doesn't go to $\infty$ is if your function gets very close to zero. 
 A: I community wiki'd this since this is basically what Ian suggested in the comments. 
Without loss of generality, restrict ourselves to integrating on the positive real line (we can "evenly" extend this to $\mathbb{R}$ if desired, since the integral will still be finite). 
Fix a convergent, positive series $ \sum a_n$ and define a bijection which assigns to each $a_i$ a triangle of area $a_i$. Choose heights such that the $\lim \sup$ of the heights is positive.  Then consider a function 
$f:[0, \infty) \to [0, \infty)$ such that the graph of this function is the triangles corresponding to each $a_i$ side to side, properly ordered, possibily with "plateaus of zero" in between. Such a function satisfies the required conditions.
It's tedious and unnecessary to find an explicit formula. If that matters a lot to you, why not try yourself, now that you have an idea what the graph looks like?
A: Well using Ian's commment of a triangle function:
Let $n_x \le |x| < n_x+1 $.
For $x$.  Let $f(n_x) = 0$.  Let $f(n_x + (1/2)^{n_x+1}) = 1$. Let $f(n_x + (1/2)^{n_x}) = 0$.
For $n_x < |x| < n_x + (1/2)^{n_x+1}$, let $f(x) = \frac{|x| -x_n}{(1/2)^{n_x+1}}$
For $n_x + (1/2)^{n_x+1}< |x| < n_x + (1/2)^{n_x}$, let $f(x) = \frac{(n_x + (1/2)^{n_x})-|x|}{(1/2)^{n_x+1}}$
For all else $f(x) = 0$.
$$\int_{n_x}^{n_x+1}f(x)\,dx = \frac 1 2 \cdot 1\cdot \left(\frac 12 \right)^{n_x} = \left(\frac 12\right)^{n_x + 1}$$
$$\int_0^\infty f(x) \, dx = \sum \left(\frac 12\right)^k = 1$$
$$\int_{-\infty}^\infty f(x) \, dx =2$$
But $f(x)$ doesn't converge however, as for any $N$ there will be $x,y > N$  where $f(x) =1$ and $f(y) = 0$.
