I have to find a function $f$ with the following properties:
$$\lim_{x \to \infty} \sup f(x) = \infty$$
$$f \in L^1$$
What I came up with was $f(x) = x^2 \sin (x)$.
$f(-x) = -f(x)$ so it is an odd function. It follows that
$$\int_{(-\infty,\infty)} f(x) d\mu = \int_{(-\infty,0)} f(x) d\mu + \int_{(\infty,0)} f(x) d\mu = \int_{(\infty,0)} f(-x) d\mu + \int_{(\infty,0)} f(x) d\mu$$
$$ = -\int_{(\infty,0)} f(x) d\mu + \int_{(\infty,0)} f(x) d\mu = 0$$
Finally, since $f(x)$ oscillates, we have a sequence of local maxima. Since the amplitude grows with $x^2$ the amplitude grows monotonically to infinity from $0$ to $\infty$. Therefore, the sequence of local maxima from $(0, \infty)$ is an increasing unbounded sequence.
This implies
$$\lim_{x\to \infty} \sup f(x) = \infty$$
Is this rigorous enough?
Best Answer
The fact is that, $f(x)=x^{2}\sin x$ does not belong to $L^{1}(\mathbb{R})$, so you cannot do the integral splitting at the first place.
You can look at $|f(x)|=x^{2}|\sin x|$ and consider the sum of the integral on the intervals $[n\pi+\pi/3,(n+1)\pi-\pi/3]$ for each $n=0,1,2,...$
An easy example would be like, $f(x)=n$ for $x=n$ and $f(x)=0$ for otherwise. Then sequence $(x_{n})$, $x_{n}=n$ is such that $\infty=\lim_{n\rightarrow\infty}f(x_{n})\leq\limsup_{x\rightarrow\infty}f(x)$ because $x_{n}\rightarrow\infty$.
$f$ is zero a.e. certainly it is integrable.