# If $f:\mathbb{R}\to[0, \infty)$ (uniformly) continuous and $f \in L^1$, then $\lim_{x\to\pm\infty}f(x)=0$?

I'm learning about measure theory and need help with the following questions:

True or False (justify):

$(1)$ If $f:\mathbb{R}\to[0, \infty)$ measurable and $f \in L^1$, then $\lim_{x\to\pm\infty}f(x)=0$.

$(2)$ If $f:\mathbb{R}\to[0, \infty)$ continuous and $f \in L^1$, then $\lim_{x\to\pm\infty}f(x)=0$.

$(3)$ If $f:\mathbb{R}\to[0, \infty)$ uniformly continuous and $f \in L^1$, then $\lim_{x\to\pm\infty}f(x)=0$.

Since I'm having some difficulties for $(2)$ and $(3)$ I'm going to show my work for $(1)$.

My work for $(1)$:

The proposition is false. We consider the characteristic function of the rationals, that is the function $f:\mathbb{R}\to\mathbb{R}$ with

$$f(x)=\chi_{\mathbb{Q}}(x) = \begin{cases} 1 &\text{if x\in\mathbb{Q}} \\ 0& \text{if x\notin\mathbb{Q}} \end{cases}.$$

The characteristic function of the rationals is measurable. It is equal to zero almost everywhere. Therefore the function $f$ is integrable and and $\int f = 0$. However $\lim_{x\to\pm\infty}f(x)$ does not exist.

Edit: Considering the great answer of Umberto P., here's my complete answer for $(2)$:

The proposition is false. We start with the constant zero function. On the interval $[1, 3]$ we raise the graph as a triangle with a top at the point $(2, 1)$. The area under the first triangle, say $A_1$, is equal to $1$. From the point $(0, 3)$ we move one unit to the right on the real axis. On the interval $[4, 4.5]$ we raise again the graph as a triangle with a top at the point $(4.25, 1)$. The area under the second triangle $A_2$ is equal to $1/4$. We repeat this process indefinitely for triangles of height $1$. The resulting function is continuous, non-negative and therefore integrable. Moreover

$$A_1=1, A_2=\frac{1}{4}, A_3=\frac{1}{9}, A_4=\frac{1}{16}, \ldots \implies \int f = \sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6}.$$

We see that the function integrates to $\frac{\pi^2}{6}$ but the graph has infinitely many bumps of height $1$. So the limit of $f$ does not exist.

On the other hand (3) is true. If the limit failed to exist or is nonzero, there is an $\epsilon > 0$ with the property that for any $x_0$ there is $x > x_0$ with $|f(x)| > \epsilon$. Since $f$ is uniformly continuous there is a $\delta > 0$ with the property that $|x-y| < \delta$ and $|f(x)| > \epsilon$ implies $|f(y)| > \epsilon/2$.
You can use this fact to find infinitely many disjoint intervals of length $2\delta$ on which $|f|$ exceeds $\epsilon/2$. This can be shown to contradict integrability.