# Pointwise and uniform convergence of sequence of functions

Let $(f_n)$ be a sequence of continuous functions on $\mathbb R$.

1. If $(f_n)$ converges to $f$ pointwise on $\mathbb R$, then $$\lim\limits_{n\to \infty}\int^{\infty}_{-\infty}f_n(x)dx=\int^{\infty}_{-\infty}f(x)dx.$$

2. If $(f_n)$ converges to $f$ uniformly on $\mathbb R$ then $$\lim\limits_{n\to \infty}\int^{\infty}_{-\infty}f_n(x)dx=\int^{\infty}_{-\infty}f(x)dx.$$

3. If $(f_n)$ converges to $f$ uniformly on $\mathbb R$ then $f$ is continuous on $\mathbb R$.

4. There exists a sequence of continuous functions $(f_n)$ on $\mathbb R$, such that $f_n$ converges to $f$ uniformly on $\mathbb R$, but $$\lim\limits_{n\to \infty}\int^{\infty}_{-\infty}f_n(x)dx\neq\int^{\infty}_{-\infty}f(x)dx.$$

The option 3. is definitely correct and option 1. is definitely wrong. But I am in confusion about 2 and 4. please help!

Define the function $g$ on $\mathbb{R}$ by $$\forall x\in\mathbb{R},\ g(x)=\frac1{1+x^2}.$$ It is well-known that $g$ is continuous on $\mathbb{R}$, that $$\int_{-\infty}^{+\infty}g(x)\,\mathrm{d}x=\pi$$ and $$\lVert g\rVert_\infty=1.$$
Define the sequence of functions $(f_n)_{n\in\mathbb{N}^*}$ on $\mathbb{R}$ as $$\forall n\in\mathbb{N}^*,\ \forall x\in\mathbb{R},\ f_n(x)=\frac1ng\left(\frac xn\right).$$
Then, clearly, for all $n\in\mathbb{N}^*$, $f_n$ is continuous on $\mathbb{R}$, $$\lVert f_n\rVert_\infty=\frac1n\lVert g\rVert_\infty=\frac1n$$ and hence $$\lim_{n\to+\infty}\lVert f_n\rVert_\infty=0$$ hence the sequence of functions $(f_n)_{n\in\mathbb{N}^*}$ converges uniformly (and hence pointwise) to the nil function $f=0$ on $\mathbb{R}$.
Now, for all $n\in\mathbb{N}^*$, $$\int_{-\infty}^{+\infty}f_n(t)\,\mathrm{d}t=\int_{-\infty}^{+\infty}\frac1ng\left(\frac tn\right)\,\mathrm{d}t\overset{(*)}=\int_{-\infty}^{+\infty}g(x)\,\mathrm{d}x=\pi$$ where for $(*)$ we used the substitution $x=\dfrac tn$.
Hence: $$\lim_{n\to+\infty}\int_{-\infty}^{+\infty}f_n(t)\,\mathrm{d}t=\pi\neq\int_{-\infty}^{+\infty}f(t)\,\mathrm{d}t=0.$$