# Constructing a counterexample, improper Integrals

Assume that i have a Riemann integrable function $$f$$ defined on $$\mathbb{R}$$ and i know that $$\int_1^{\infty}f(x)dx$$ exists. How can i show that this doesnt necessarily imply $$\liminf\limits_{x\to\infty}|f(x)|=0$$? Constructing a counter example that contradicts this for $$\limsup$$ seems possible (e.g function consisting of triangles with shrinking width) but i have no clue how to go about this for $$\liminf$$.

• Have +1 for a bit then -1 for a bit. Alternate more quickly as n gets big.
– Eric
May 25 at 17:57
• That sounds reasonable, could you help me out on how to construct the intervals of such function? Should i successively half the width of the intervals? May 25 at 18:59
• you can probably take $f(x)=(-1)^{\lfloor x^2\rfloor}$ math.stackexchange.com/a/649094/399263
– zwim
May 25 at 20:07

Take $$f(x) = \sum_{k=0}^\infty (-1)^k\phi_k(x)$$ where

$$\phi_k(x) =\begin{cases}1, & 1+H_k \leqslant 1+ H_{k+1}\\ 0, & \text{otherwise} \end{cases}; \quad H_0 = 1, H_k = \sum_{j=1}^k \frac{1}{j}$$

Note that $$\cup_{k=0}^\infty I_k =\cup_{k=0}^\infty [1+H_k,1+H_{k+1})= [1,\infty)$$ since $$H_k \to \infty$$ as $$k \to \infty$$.

Since

$$\int_1^\infty \phi_k(x) \, dx = \int_{1+H_k}^{1+H_{k+1}} (1)\, dx = H_{k+1}- H_k = \frac{1}{k+1},$$

it follows that

$$\int_1^\infty f(x) \, dx = \sum_{k=0}^\infty \frac{(-1)^k}{k+1} = \log 2$$

However, $$|f(x)| = 1$$ for all $$x \geqslant 1$$.