# Gap between the Uniform and Uniform convergence on compacts topologies

Let $$X$$ and $$Y$$ be the set $$C_0(\mathbb{R})$$ (of functions vanishing at infinity) equipped with the topologies of compact-convergence and uniform convergence respectively. The second is clearly stronger than the first (as the closure of the compactly-supported functions differ in these cases) but what is an example of a function $$f \in C_0(\mathbb{R})$$ and a sequence $$\{f_n\}$$ there such that

• $$\lim\limits_{n\to \infty} f_n(x) =f(x)$$ in $$X$$
• $$\lim\limits_{n\to \infty} f_n(x) \neq f(x)$$ in $$Y$$?

I think you can start with any non-constant function $$g$$ in $$C_0(\mathbb{R})$$ and build such a sequence by defining $$f_n(x) = g(x-n)$$.
Now in the topology of the compact convergence this sequence converges to the function $$f \equiv 0$$, since for any compact set $$K\subset \mathbb{R}$$ you can find some integer $$n$$ such that $$f_n(x)$$ is pushed so far to the right that its value on $$K$$ gets arbitrarily small.
However in the topology of the uniform convergence this sequence never converges to $$f\equiv 0$$ (nor to any other function) since its supremum and infimum remain constant and by hypothesis at least one of them is nonzero.