# sequence of functions with compact support converges to function which will vanish at infinity

Let $(f_n)_{n \in \mathbb{N}}$ be a sequence of real-valued continuous functions on $\mathbb{R}$ which converges to $f:\mathbb{R} \rightarrow \mathbb{R}$ uniformly, where $f$ is also continuous. If each $f_n$ has a compact support for all $n \in \mathbb{N},$ is it true that $f$ will vanish at infinity, that is, $\lim_{x \rightarrow \infty}f(x) = 0?$

Denote the supremum norm $\|f\|_{\infty} = \sup_{x \in \mathbb{R}}|f(x)|.$

I think the answer is yes, but I couldn't show it completely. Below is my incomplete proof.

My attempt: Let $\varepsilon>0$ be given. Since $(f_n)$ converges to $f$ uniformly, there exists a natural number $N$ such that for all $n \geq N,$ we have $\|f_n-f\|_{\infty} < \varepsilon.$ Fix such $N.$ Since $f_N$ has compact support, in particular, it is bounded, there exists $x \in \mathbb{R}$ such that $f_N(x) = 0$ where $x \geq N$ (I am not very sure about this inequality).

Hence, for all $x \geq N,$ we have $$|f(x) | \leq |f(x) - f_N(x)| + |f_N(x)| \leq \|f - f_N\| < \varepsilon.$$

I think something is wrong. But I couldn't point it out.

About your inequality: After you fixed $N$, since $f_N$ has compact support, there exists $M \gt0$ such that $supp(f_N) \subset [-M,M]$. Then for all $x \gt M$, you have $|f(x)| \lt \epsilon$.