Applications of Tietze Extension Theorem

One application I particularly like, from an undergraduate analysis exam problem:

Theorem: A metric space $X$ is compact if and only if every continuous real-valued function on $X$ is bounded.

Proof: Assume first $X$ is compact. If $f:X\to \mathbb R$ is continuous and unbounded, then we have some sequence $(x_n)$ in $X$ such that $f(x_n)>n,\forall n\in\mathbb N$. Since $X$ is compact, we have some convergent subsequence $(x_{n_k})$, so $\lim\limits_{k\to\infty}f(x_{n_k})=f(\lim\limits_{k\to\infty}x_{n_k})$. But this is impossible, as $f(x_{n_k})\to\infty$, hence any continuous real-valued function is bounded. If instead $X$ is not compact, then we have some sequence $(x_n)$ in $X$ which has no convergent subsequence. Hence every convergent sequence with terms in the set $S=\{x_1,x_2,\ldots\}$ must be eventually constant, so has limit in $S$, hence $S$ is closed. Define the function $f:S\to \mathbb R$ by $f(x_n)=n$, which is continuous because $S$ is a discrete set. By the Tietze extension theorem, we can extend $f$ to a continuous unbounded function $g:X\to\mathbb R$.


I'm not sure if the following proof works, but it uses the Tietze extension theorem, among other things, to prove the density of $C_{0}(\mathbb{R})$ in $L^{1}$.