Prove that this space of functions is closed in $C_{B}(X, \mathbb{R})$ Let $C_0(X,\mathbb{R})$ be the space of continuous functions $f:X\to\mathbb{R}$ that go to $0$ at infinity, i. e. for every $\epsilon>0$ there exists a compact $E\subset X$ such that $|f(x)|<\epsilon$ for every $x\not\in E$.
So the conclusion is that $C_0(X,\mathbb{R})$ is a closed subspace of $C_B(X,\mathbb{R})$.
I was triying to use that If we have a compact subspace then it should be closed, but I think it will be more difficult to prove compactness, than closeness, And I don't have any other equivalence for closeness. Then my question is How can I prove this ?
And other thing, Where am I going to use that $E$ is compact?
Now I am triying to prove that this space is complete, but the thing is that I don't know how to get the result with the hypotheses I've got 
Can someone help me to prove this?
I have realize the following argument, let's take a sequence such that it converges to some function $f$ and we will proof that it is in $C_0(X,\mathbb{R})$, for that we fix $x \notin E $ and then we proceed as follows
$$|f(x)|=|f(x)-f_n(x)+f_n(x)| \le |f(x)-f_n(x)|+|f_n(x)|\le \frac{\epsilon}{2}+ \frac{\epsilon}{2}=\epsilon$$ 
Now the question is Am I right in this?, and How can I prove that $C_0(X,\mathbb{R})$ is a subspace of $C_B(X,\mathbb{R})$?
Thanks a lot in advance.
 A: I presume that you are using the uniform metric on $C_B$: if $f,g$ are two functions in $C_B$, then their distance is defined as
$$d(f,g) = \sup_{x \in X}|f(x) - g(x)|$$
First note that $C_0$ is a subspace of $C_B$. To see this, let $f$ be any function in $C_0$. Then $f$ is continuous and $|f(x)| < \epsilon$ for all $x$ outside some compact set $E \subseteq X$. Since a continuous function on a compact set is bounded, $f$ is bounded on $E$, say $|f(x)| < M$ for all $x \in E$. Then $|f(x)| < \max(M, \epsilon)$ for all $x \in X$.
To show that $C_0$ is a closed subspace of $C_B$, assume that $f \in C_B$ is a limit point of $C_0$. We need to show that $f \in C_0$.
So, fix $\epsilon > 0$. The goal is to show that $|f(x)| < \epsilon$ for all $x$ outside some compact subset of $X$. Since $f$ is a limit point of $C_0$, there is a sequence $(f_n)$ of functions in $C_0$ such that $d(f_n, f) \to 0$ as $n \to \infty$. So, there is some $N$ such that $d(f_n, f) < \epsilon/2$ for all $n \geq N$. In particular, $d(f_N, f) < \epsilon / 2$.
Now, $f_N \in C_0$, so there is some compact set $E \subseteq X$ such that $|f_N(x)| < \epsilon / 2$ for all $x \not\in E$.
Therefore, by the triangle inequality, for all $x \not\in E$ we have
$$\begin{aligned}
|f(x)| &\leq |f(x) - f_N(x)| + |f_N(x)| \\
& \leq |f(x) - f_N(x)| + \epsilon / 2 \\
&\leq \sup_{x \in X}|f(x)- f_N(x)| + \epsilon / 2\\
&= d(f, f_N) + \epsilon / 2 \\
&< \epsilon / 2 + \epsilon / 2 \\
&= \epsilon
\end{aligned}$$
