$C_0(X)$ is a closed subspace of $C_b(X)$ Can you tell me if my proof is correct? Thank you!
Claim: $C_0(X)$ is a closed subspace of $C_b(X)$
Proof: We have to show that $C_0(X)$ contains all of its limit points. Let $f(x)$ be a limit point of it, then we have a sequence $f_n$ converging to it (in $\|\cdot\|_\infty$) hence $f_n$ is a Cauchy sequence (with respect to $\|\cdot\|_\infty$). Of course, $f$ is continuous since it's the uniform limit of a sequence of continuous functions. So we only have to show that $f(x)$ vanishes at $\pm \infty$ (apparently, $X \subset \mathbb R$? See here for a definition of $C_0(X)$. I'd have thought it's more general but then what does $x \to \infty$ mean in a general topological space?)
Let $\varepsilon>0$. Let $N$ be such that $m,n \geq N$ implies $\|f_n - f_N\|_\infty \leq \varepsilon/2$. Then
$$ |f(x)| \leq |f(x) - f_N(x)| + |f_N(x)| \leq \varepsilon$$
for $x \in X \setminus K_N$ where $|f_N(x)| \leq \varepsilon/2$ outside some $K_N$, $K_N$ compact. Also, for all $x$, $|f(x) - f_N(x)| = \lim_{m \to \infty} |f_m(x) - f_N(x)| \leq \varepsilon/2$ since $|f_m(x) - f_N(x)| \leq \|f_m - f_N\|_\infty \leq \varepsilon / 2$ for all $m > N$.
 A: I don’t see any reason to get bogged down with the Cauchy property: given $\epsilon>0$ you know that there is an $n\in\Bbb N$ such that $\|f-f_n\|_\infty<\epsilon/2$, and you know that there is a compact $K_n\subseteq X$ such that $|f_n(x)|<\epsilon/2$ for $x\in X\setminus K_n$. It follows that $$|f(x)|\le|f(x)-f_n(x)|+|f_n(x)|<\epsilon$$ for $x\in X\setminus K_n$. Since $\epsilon$ was arbitrary, it further follows that $\lim_{x\to\infty}f(x)=0$.

You can’t talk about the limit at infinity in an arbitrary topological space, but you can do so in a locally compact space. Indeed, the definition is in your earlier question:

$\lim_{x\to\infty}f(x)=A$ if and only if for every $\epsilon>0$ there exists some compact set $K\subseteq X$ with $|f(x)-A|<\epsilon$ for all $x\in X\setminus K$.

This works because if $X$ is Hausdorff, locally compact, and not compact, it has a one-point compactification, a compact Hausdorff space $X^*$ formed as follows. Let $\infty$ be a point not in $X$; then in $X^*=X\cup\{\infty\}$, open nbhds of $\infty$ are sets of the form $X^*\setminus K$ where $K$ is a compact subset of $X$, and the subspace topology on $X$ as a subspace of $X^*$ coincides with the original topology on $X$. As an example, if $X=(0,1)$ with the usual topology, $X^*$ is homeomorphic to $S^1$, the circle with the usual topology. If $X=\Bbb N$ with the discrete topology, $X^*$ is homeomorphic to the subspace $$\{0\}\cup\{2^{-n}:n\in\Bbb N\}$$ of $\Bbb R$. (Note that this compactification adds only one point $\infty$; it does not make sense to talk about $\pm\infty$ in this context.)
The definition given above of $\lim_{x\to\infty}f(x)$ really makes sense only when $X$ is Hausdorff, locally compact, and not compact, and in that case it’s equivalent to saying that if we extend $f:X\to\Bbb R$ to a function $\hat f:X^*\to\Bbb R$ by setting $\hat f(\infty)=A$, then $\hat f$ is continuous at $\infty$.
