Integrable function $f$ on $\mathbb R$ does not imply that limit $f(x)$ is zero

1) Construct a continuous function $f$ on $\mathbb{R}$ that is integrable on $\mathbb{R}$ but $\displaystyle\limsup_{x \to \infty} f(x) = \infty$.

I took the function that is equal to $n$ on $[n, n + 1/n^{3})$ and made it continuous by saying that $f$ is the line segment joining $n$ and $n+1$ on $[n + 1/n^{3}, n+1)$. But I am failing to prove this integrable. For this, $\lim f(x) = \infty$ but how do you prove in general, if limit does not exist that $\limsup$ is infinity?

2) Prove that if $f$ is uniformly continuous and integrable on $\mathbb{R}$ we have $\displaystyle\lim_{|x| \to \infty} f(x) = 0$.

Any help is appreciated.

Thanks


The basic idea for the function in part 1 is to let the measure control the convergence of the sum, as opposed to the function value. Here's an idea to get you started: Consider a function $f(x)$ that is defined by isosceles triangles of base $\frac{1}{2^n}$ and height $1$ on the intervals $[n,n+\frac{1}{2^n}]$, and $0$ everywhere else. The $n^{th}$ triangle has area $\frac{bh}{2}=\frac{1}{2^{n+1}}$, so $$\int_\mathbb{R} f(x)d\mu=\sum_{n=0}^\infty\frac{1}{2^{n+1}}$$ which clearly converges. Can you think of a way to modify this so the height of the triangles is increasing, yet the sum will still converge?


Hints:

1) You need the function to be near $0$ on most of the interval $[n, n+1]$ in order to make it integrable.

2) If $f$ is uniformly continuous, given $\epsilon > 0$ there is $\delta > 0$ such that if $f(x) > \epsilon$, $f(t) > \epsilon/2$ for $x - \delta < t < x + \delta$, implying $\int_{x-\delta}^{x+\delta} f(t)\ dt > \epsilon \delta$. You can't have too many disjoint intervals like that.