[proofplan]
We prove completeness of $C_0(X)$ by showing it is a closed subspace of the complete space $C_b(X)$ (bounded continuous functions with the supremum norm). The key observation is that the uniform limit of functions vanishing at infinity also vanishes at infinity: the "tail" of the limit is controlled by the "tail" of a sufficiently close approximant plus the uniform error. Density of $C_c(X)$ in $C_0(X)$ follows directly from the definition of vanishing at infinity: truncating by a compactly supported Urysohn function on a large compact set approximates any $C_0$ function uniformly.
[/proofplan]
[step:Recall that $C_b(X)$ with the supremum norm is a Banach space]
The space $C_b(X)$ of bounded continuous functions $f: X \to \mathbb{R}$ is a Banach space under the supremum norm $\|f\|_\infty := \sup_{x \in X} |f(x)|$. This is a standard completeness result: if $(f_j)_{j=1}^\infty$ is a Cauchy sequence in $C_b(X)$, then for each $x \in X$ the sequence $(f_j(x))_{j=1}^\infty$ is Cauchy in $\mathbb{R}$ (since $|f_j(x) - f_k(x)| \le \|f_j - f_k\|_\infty$), hence converges to some value $f(x)$. The convergence $f_j \to f$ is uniform (given $\varepsilon > 0$, choose $N$ so that $\|f_j - f_k\|_\infty < \varepsilon$ for $j, k \ge N$; fixing $j \ge N$ and sending $k \to \infty$ gives $\|f_j - f\|_\infty \le \varepsilon$). The uniform limit of continuous functions is continuous, and the uniform limit of bounded functions is bounded, so $f \in C_b(X)$.
Since $C_0(X) \subset C_b(X)$ (every function vanishing at infinity is bounded), it suffices to show $C_0(X)$ is a closed subspace of $C_b(X)$.
[/step]
[step:Show $C_0(X)$ is closed in $C_b(X)$]
Let $(f_j)_{j=1}^\infty$ be a sequence in $C_0(X)$ converging to $f \in C_b(X)$ in the supremum norm. We show $f \in C_0(X)$.
Fix $\varepsilon > 0$. Choose $N \in \mathbb{N}$ such that $\|f_N - f\|_\infty < \varepsilon/2$. Since $f_N \in C_0(X)$, there exists a compact set $K \subset X$ with $|f_N(x)| < \varepsilon/2$ for all $x \in X \setminus K$.
For any $x \in X \setminus K$, the triangle inequality gives
\begin{align*}
|f(x)| \le |f(x) - f_N(x)| + |f_N(x)| < \frac{\varepsilon}{2} + \frac{\varepsilon}{2} = \varepsilon.
\end{align*}
Since $K$ is compact and $\varepsilon > 0$ was arbitrary, the function $f$ vanishes at infinity. Therefore $f \in C_0(X)$, and $C_0(X)$ is closed in $C_b(X)$.
A closed subspace of a Banach space is a Banach space (with the restricted norm), so $C_0(X)$ is a Banach space.
[guided]
The argument has a clear structure: to show $f$ vanishes at infinity, we must produce, for each $\varepsilon > 0$, a compact set outside which $|f| < \varepsilon$. The idea is to "borrow" the compact set from a nearby function $f_N$ that already vanishes at infinity.
Since $f_N$ vanishes at infinity, there exists a compact $K$ outside which $|f_N| < \varepsilon/2$. Since $\|f - f_N\|_\infty < \varepsilon/2$ (by choosing $N$ large enough), the triangle inequality gives $|f(x)| < \varepsilon$ outside $K$.
Why does this not work for an arbitrary subspace of $C_b(X)$? Because the vanishing-at-infinity condition is a "uniform tail decay" requirement. The key is that we can always find a single compact set $K$ (depending on $f_N$ and $\varepsilon$) that controls the tail of $f_N$, and the uniform approximation transfers this control to $f$. This is a uniform argument, not a pointwise one — and the supremum norm makes this transfer exact.
[/guided]
[/step]
[step:Show $C_c(X)$ is dense in $C_0(X)$]
Let $f \in C_0(X)$ and fix $\varepsilon > 0$. By the definition of vanishing at infinity, there exists a compact set $K \subset X$ with $|f(x)| < \varepsilon$ for all $x \in X \setminus K$.
Since $X$ is locally compact Hausdorff, we can find a compact set $L$ with $K \subset \operatorname{int}(L)$ (using the construction from the proof of [Urysohn's Lemma for Locally Compact Hausdorff Spaces](/theorems/1065): cover $K$ by finitely many precompact open sets and take the union of their closures). By the [Urysohn's Lemma for Locally Compact Hausdorff Spaces](/theorems/1065), there exists a function $\varphi \in C_c(X)$ with $\varphi \equiv 1$ on $K$, $0 \le \varphi \le 1$, and $\operatorname{supp}(\varphi)$ compact.
Define $g := \varphi \cdot f$. Since $\varphi \in C_c(X)$ and $f$ is continuous, $g$ is continuous. The support of $g$ is contained in $\operatorname{supp}(\varphi)$, which is compact. Therefore $g \in C_c(X)$.
We estimate the approximation error. For $x \in K$, we have $\varphi(x) = 1$, so $|f(x) - g(x)| = |f(x) - f(x)| = 0$. For $x \in X \setminus K$, we have $|f(x)| < \varepsilon$ and $0 \le \varphi(x) \le 1$, so
\begin{align*}
|f(x) - g(x)| = |f(x) - \varphi(x) f(x)| = |f(x)| \cdot |1 - \varphi(x)| \le |f(x)| < \varepsilon.
\end{align*}
Therefore $\|f - g\|_\infty \le \varepsilon$. Since $\varepsilon > 0$ was arbitrary, $C_c(X)$ is dense in $C_0(X)$.
[guided]
The density argument is a standard truncation: multiply $f$ by a compactly supported cutoff function $\varphi$ that equals $1$ on a large compact set $K$. The error $f - \varphi f = f(1 - \varphi)$ is supported outside $K$, where $|f| < \varepsilon$ because $f$ vanishes at infinity. Since $|1 - \varphi| \le 1$, the error is at most $\varepsilon$ in the supremum norm.
The existence of the cutoff function $\varphi$ is precisely the content of [Urysohn's Lemma for Locally Compact Hausdorff Spaces](/theorems/1065). Without local compactness, we would not be able to produce a compactly supported continuous function that equals $1$ on $K$.
Note the logical dependency: the density of $C_c(X)$ in $C_0(X)$ relies on the locally compact Hausdorff version of Urysohn's lemma, which in turn relies on the normality of compact Hausdorff spaces and the classical Urysohn's lemma. Each layer of the theory builds on the previous one.
[/guided]
[/step]