All functions here are from $\Bbb{R}$ to $\Bbb{R}$ and I use the supremum metric $d$.
$C_c=$ continuous functions with compact support and $C_0 = \{f: \forall \epsilon > 0 \ \exists K \subseteq X \text{ compact} : \vert f(x) \vert \lt \epsilon \text{ on } X \setminus K\}$, i.e, continuous functions vanishing at infinity.
I thought that I could prove this in 2 steps:
a) $C_c$ is dense in $C_0$.
b) $(C_0,d)$ is complete.
For part a), I argued as follows:
Let $f\in{C_0}$ and $\epsilon \gt 0$. Then by definition, there exists $K\subset{\Bbb{R}}$ compact such that $\vert f(x) \vert \lt \epsilon/2 \text{ on } \Bbb{R} \setminus K$. Take the function $g$ such that $g=f$ on $K$, and $g(x)=0$ outside of $K$. Then it is clear that $g$ belongs to $C_c$, and $d(f,g)\lt \epsilon$. For, on $K$ functions are equal so $d(f,g)=0$ and on $\Bbb{R} \setminus K$ we have $d(f,g)= \text{sup}\vert f \vert\le \epsilon/2 \lt \epsilon$.
My problem is that I am not sure whether the function $g$ is continuous with this construction, and if it is how to show it. Also, does this proves part a) correctly?
A much more important problem for me is part b), because I have no idea how to approach this.
Lastly, can we show the completion by using both parts a) and b), or do we need an extra condition? I do not really want to get into too much with the technical approach of completion (such as Cauchy construction).
Best Answer
The completion of a metric space $X$ is a complete metric space $X'$ such that:
In other words, $X'$ is the 'minimal' complete container of $X$. Theorem:
So, you might as well take this to be the definition too.
So, you need to check $a),b)$ and you also need to check that the inclusion $C_c\hookrightarrow C_0$ is an isometry. That's true since you are using the 'same' metric.
Your proof of $a)$ is not quite right since the $g$ thus defined is not continuous, necessarily. One easy way round this:
Let's check the completeness of $C_0$, I'll leave some hints.
It is very important that the uniform metric is used here. Suppose there is a sequence $(f_n)_{n\in\Bbb N}\subseteq C_0$ which is Cauchy in the uniform metric.
Conclude $C_0$ is complete!