# Is there a function with infinite integral on every interval?

Could give some examples of nonnegative measurable function $f:\mathbb{R}\to[0,\infty)$, such that its integral over any bounded interval is infinite?

• Would a simple counting function do? – Henry Mar 1 '11 at 13:48

The easiest example I know is constructed as follows. Let $q_{n}$ be an enumeration of the rational numbers in $[0,1]$. Consider $$g(x) = \sum_{n=1}^{\infty} 2^{-n} \frac{1}{|x-q_{n}|^{1/2}}.$$ Since each function $\dfrac{1}{|x-q_{n}|^{1/2}}$ is integrable on $[0,1]$, so is $g(x)$ [verify this!]. Therefore $g(x) < \infty$ almost everywhere, so we can simply set $g(x) = 0$ in the points where the sum is infinite.
On the other hand, $f = g^{2}$ has infinite integral over each interval in $[0,1]$. Indeed, if $0 \leq a \lt b \leq 1$ then $(a,b)$ contains a number $q_{n}$, so $$\int_{a}^{b} f(x)\,dx \geq \int_{a}^{b} \frac{1}{|x-q_{n}|}\,dx = \infty.$$ Now in order to get the function $f$ defined at every point of $\mathbb{R}$, simply define $f(n + x) = f(x)$ for $0 \leq x \lt 1$.
• I can highly recommend N. L. Carothers's Real Analysis. It's an excellent textbook for a first course on analysis in metric spaces assuming that the students are familiar with the basics of real sequences and continuous functions. Its only (major) flaw in my opinion is that the part on meassure theory only deals with the case of the Lebesgue meassure on $\mathbb{R}$ (no abstract meassure spaces, no Tonelli/Fubini etc.), but the concrete approach does have its pedagogical advantages I suppose (but having to redo a lot of work when one gets to abstract meassure spaces seems suboptimal) – kahen Mar 1 '11 at 14:10