Pointwise limit of integrable function

Here is another natural example on $\mathbb{R}$ with the Lebesgue measure, which works also on $\mathbb{Z}$ with the counting measure: $$ f_n=1_{[-n,n]} $$ Use the Monotone Convergence Theorem.

In the same spirit, we can do even worse. Take $$ g_n=-1_{[-n,0)}+1_{(0,n]}. $$ Then all the $g_n$'s have $0$ integral. So $\lim _n \int g_n=0$ exists. Yet the pointwise limit is not integrable. Again neither on $\mathbb{R}$ nor on $\mathbb{Z}$.


Just in case your question is about Riemann integrability, I will provide a sequence of Riemann integrable functions $f_n\colon[0,1]\to\mathbb{R}$ such that $\lim_{n\to\infty}f_n(x)=f(x)$ exists for all $x\in[0,1]$ but $f$ is not integrable in the sense of Riemann.

Order the rationals in $[0,1]$: $$ [0,1]\cap\mathbb{Q}=\{r_n\}_{n=1}^\infty. $$ Let $$ \phi_n(x)=\begin{cases} 1 &\text{if }x=r_n,\\ 0 &\text{otherwise} \end{cases} \quad\text{and}\quad f_n(x)=\sum_{k=1}^n\phi_k(x). $$ Then $f_n$ is Riemann integrable, since it has a finite number of discontinuities ($r_1,\dots,r_n$), but $$ f(x)=\lim_{n\to\infty}f_n(x)=\sum_{k=1}^\infty\phi_k(x)=\begin{cases} 1 &\text{if }x\text{ is rational}\\ 0 &\text{if }x\text{ is irrational} \end{cases} $$ is not Riemann integrable (althoug it is Lebesgue integrable).


Yes, a specific example is what you need, and you might start by looking at a well-known function which is not integrable (for example $f(x)=1/x$) and then find some integrable functions which converge to $f$ - e.g. consider the functions $f_n(x) = \max(f(x),n)$. I will let you check the details ...