# Question about finding specific examples of functions in $L^1[0,\infty)$.

Suppose $f$ is a continuous and $f\in L^1[0,\infty)$. I want help in finding examples where
1. if $\lim_{x\to\infty} f(x)$ exists, then $\lim_{x\to\infty} f(x)= 0$.

1. if $\lim_{x\to\infty} f(x)$ does not exists, then $\lim_{x\to\infty} f(x)\neq 0$.

Edit: 2. an example in which $f\in L^1[0,\infty)$ and $\lim_{x\to \infty} f(x)$ does not exist.

PS

Could some please find an appropriate title? Thanks.

-
I forgot the function $f(x)$. –  Jack Mar 22 '12 at 22:18
I don't understand 2. Something (the limit $\lim_x f(x)$) which doesn't exist, can't be $\ne 0$. –  martini Mar 22 '12 at 22:30
@martini Sorry. I edited it. –  Jack Mar 22 '12 at 22:41

if the limit exists, it has to be zero. For if we had $\lim_{x\to \infty} f(x) =: \eta > 0$, say, we have $f(x) > \frac\eta 2$ for $x \ge M$ for some $M$, and so $\int_{[0,\infty)} |f(x)|\, dx = \infty$, contradicting $f \in L^1[0,\infty)$. For an example you could take the zero function.
For an example where the limit doesn't exist: Let $f:[0,\infty) \to \mathbb R$ defined by $$f(x) = \begin{cases} n^2(x - n) & n \le x \le n + \frac 1{n^2} & n \ge 2\\\ -n^2(x - n - \textstyle\frac 2{n^2}) & n + \frac 1{n^2} \le x \le n+\frac 2{n^2} & n \ge 2\\\ 0 & \text{otherwise} \end{cases}$$ Then $f$ is continuous, has $\int_{[0,\infty)} f(x)\,dx = \sum_{n=2}^\infty \frac1{n^2} < \infty$. We now have $f(n) = 0$ for every $n \ge 2$, but $f(n + \frac 1{n^2}) = 1$, so $\lim_{x\to\infty} f(x)$ doesn't exists,