# How to prove the density result？

How to prove that $C_c^\infty(R^n)$ is dense in $C^0(R^n)$,where the topology of $C^0(R^n)$ defined as follows

$u_k\rightarrow 0$ in $C^0(R^n)$ if and only if $\forall K\subset\subset R^n$,$sup_{x\in K}|u_k|\rightarrow 0$.

PS:I can prove $C_c^\infty(R^n)$ is dense in $C^\infty(R^n)$ and $C^\infty(R^n)$ is dense in $C^0(R^n)$, but confuse how to combine with the two result to complete the proof of my question.Is my idea correct？

-
dense is transitive – Hagen von Eitzen Jan 13 '13 at 13:01
Expanding on Hagen's comment, you can show in general that if $X$ is a topological space and $A\subset B\subset X$ such that $B$ is dense in $X$ and $A$ is dense in $B$, then $A$ is dense in $X$. – Jonas Meyer Jan 14 '13 at 4:59

Now I give a explanation in details based on Hagen von Eitzen and Jonas Meyer. Actually, the only thing you should to know is that the topology of function space $C^0(\mathbb{R}^n)$ is weaker than the topology of $C^\infty(\mathbb{R}^n)$, see below $$u_k\rightarrow 0\text{ in }C^\infty(\mathbb{R}^n)\quad\text{iff}\quad \forall K\subset\subset\mathbb{R}^n,\forall\alpha\in\mathbb{N}_0^n,\sup_{x\in K}|\partial^\alpha u_k(x)|\rightarrow 0.\tag{1}$$
As you already know, $\forall u \in C^0(\mathbb{R}^n)$, there is a sequence $\{u_k\}_{k=1}^\infty\subset C^\infty(\mathbb{R}^n)$ such that $$u_k\rightarrow u\text{ in }C^0(\mathbb{R}^n)\quad\text{as}\quad k\rightarrow\infty.\tag{2}$$
For each $u_k$, there is a sequence $\{u_{k,l}\}_{l=1}^\infty\subset C_0^\infty(\mathbb{R}^n)$ such that $$u_{k,l}\rightarrow u_k\text{ in }C^\infty(\mathbb{R}^n)\quad\text{as}\quad l\rightarrow\infty.\tag{3}$$
Note that $(1)$&$(3)$ implys $$u_{k,l}\rightarrow u_k\text{ in }C^0(\mathbb{R}^n)\quad\text{as}\quad l\rightarrow\infty.\tag{4}$$
Set $v_m:=u_{m,m}\in C_0^\infty(\mathbb{R}^n)$, it follows $(2)$&$(4)$ that $$v_m\rightarrow u\text{ in }C^0(\mathbb{R}^n)\quad\text{as}\quad m\rightarrow\infty.$$