Stone–Čech Compactification

Compact spaces are where topology is easiest. Continuous functions hit their max, sequences (well, nets) have convergent subsequences, and closed sets behave. Most spaces you care about aren't compact, though: $\mathbb{R}$ runs off to infinity, $(0, 1]$ has a hole at $0$, and $\mathbb{N}$ is nothing but holes.

So here's the plan: stuff the space inside a compact one, adding as few new points as you can get away with. It turns out there are many ways to do that, and they really are different. This page builds the biggest one, $\beta X$, the compactification that every bounded continuous function extends to. Then we meet $\beta\mathbb{N}$, which is a genuinely strange place. Practice sits right after each idea, and the Mixed Practice at the bottom takes that hint away.

Squeezing a Space Into a Compact One

Start with the real line. Squash it into the open interval $(-1, 1)$ with $x \mapsto \frac{x}{1 + |x|}$, then add the two endpoints. Or bend it into a circle and add one point at the top. Both times you end up with a compact space, and the line is sitting inside it with nothing left over far away.

Both pictures share three features: the big space is compact, it's Hausdorff, and the old space is dense in it, so every new point is a limit of old ones. That's the definition.

A compactification of a space $X$ is a compact Hausdorff space $Y$ that contains $X$ as a subspace, such that $\overline{X} = Y$.

Three conditions, and each one can fail on its own. Check them on some candidates.

Which of these is a compactification of $X = (0, 1)$: $(0, 1]$, $[0, 1] \cup \{2\}$, $[0, 1]$?


$(0, 1]$: Hausdorff, and $(0, 1)$ is dense in it, but it isn't compact: the open cover by the sets $(\frac{1}{n}, 1]$ has no finite subcover. Not a compactification.

$[0, 1] \cup \{2\}$: compact and Hausdorff, but the point $2$ has the neighborhood $(1.5, 2.5)$, which misses $(0, 1)$. So $(0, 1)$ is not dense. Not a compactification.

$[0, 1]$: compact, Hausdorff, and every point of $[0, 1]$ is a limit of points of $(0, 1)$. A compactification.

The points you added get a name, since they're the whole story.

If $Y$ is a compactification of $X$, the set $Y \setminus X$ is the remainder of $Y$.

The interval $[-1, 1]$ gives the line a remainder of two points; the circle gives it a remainder of one. When are two compactifications "the same"? Not just when they're homeomorphic. They have to be the same around $X$.

Two compactifications $Y_1$ and $Y_2$ of $X$ are equivalent if there is a homeomorphism $h\colon Y_1 \to Y_2$ with $h(x) = x$ for every $x \in X$.

An equivalence fixes every point of $X$ and is a bijection, so it carries the remainder of $Y_1$ onto the remainder of $Y_2$. That alone tells the two compactifications of $\mathbb{R}$ apart.

Show that the compactifications $[-1, 1]$ and $S^1$ of $\mathbb{R}$ described above are not equivalent.

Show proof

Proof. Suppose $h\colon [-1, 1] \to S^1$ is a homeomorphism with $h(x) = x$ for every $x$ in (the copy of) $\mathbb{R}$. Since $h$ is a bijection that fixes every point of $\mathbb{R}$, it sends the points not in $\mathbb{R}$ to points not in $\mathbb{R}$, bijectively: $h$ maps the remainder $\{-1, 1\}$ one-to-one onto the remainder of $S^1$, which is a single point. A two-point set can't map one-to-one onto a one-point set. $\blacksquare$

Strictly speaking, neither $[-1, 1]$ nor $S^1$ contains $\mathbb{R}$; they contain homeomorphic copies of it. That always happens, and it's harmless. If $h\colon X \to Z$ is an imbedding, swap each point $h(x)$ of $Z$ for $x$ itself and carry the topology along. From now on we do that without comment. Here are three compactifications of the same space $X = (0, 1]$, with three different remainders.

Find the remainder of each compactification of $X = (0, 1]$, where $X$ is identified with its image under the given imbedding:


Each $h_i$ is an imbedding: $h_1$ is the identity, $h_2$ has first coordinate $x$, so its inverse on the image is the projection to that coordinate, and $h_3(x)$ has distance $1 + x$ from the origin, so its inverse is $p \mapsto |p| - 1$. Each $Y_i$ is closed and bounded in $\mathbb{R}$ or $\mathbb{R}^2$, so it is compact, and it's Hausdorff as a subspace of a metric space. By construction $X$ is dense in it.

$Y_1$: the remainder is $\{0\}$.

$Y_2$: a point $(0, t)$ with $-1 \le t \le 1$ is a limit of graph points: $\sin(1/x) = t$ at $x = 1/(\theta + 2\pi k)$ for $\theta = \arcsin t$ and every $k$, and these $x$ go to $0$. Points with first coordinate $0$ and $|t| > 1$ aren't limits, and neither is anything else off the graph. So the remainder is the segment $\{0\} \times [-1, 1]$.

$Y_3$: as $x \to 0$, the distance $1 + x$ goes to $1$ while the angle $1/x$ goes round and round. Every point $(\cos\theta, \sin\theta)$ is a limit (take $x = 1/(\theta + 2\pi k)$), and points off the unit circle aren't limits of the tail. So the remainder is the whole unit circle.

A point, a segment, a circle. These are honestly different compactifications: an equivalence would map the remainders bijectively and homeomorphically onto each other, and a point, a segment, and a circle are pairwise not homeomorphic. Your turn to judge some candidates.

Loading practice engine...

So how do you tell compactifications apart without drawing them? Ask which functions extend to them. A continuous $f\colon X \to \mathbb{R}$ extends to $Y$ if there's a continuous $F\colon Y \to \mathbb{R}$ with $F = f$ on $X$. Since $X$ is dense, the value of $F$ at a new point is forced: it's the limit of $f$ as you approach that point from inside $X$. So $f$ extends exactly when that limit exists at every new point. Watch $\sin(1/x)$ try.

$\sin(1/x)$ has no limit at $0$, so it can't extend to $Y_1 = [0, 1]$. But in $Y_2$ the graph spreads that bad behavior over a whole segment, and at each point $(0, t)$ the function settles down to $t$. Two different routes into the same point give the same answer for $\sin(1/x)$, and not for $\cos(1/x)$.

Now try it yourself. Pick a compactification and a function, drag the probe around the remainder, and shrink the neighborhood. If the values of $f$ inside the neighborhood squeeze down to one number, that number is the extension's value there.

Extend It

Notice that $\cos(1/x)$ does settle down at the two ends $(0, \pm 1)$ of the segment in $Y_2$, and still doesn't extend, because it has to settle down at every new point. Here's the whole table, with the reason in each case.

Which of $x\sin(1/x)$, $\sin(1/x)$, $\cos(2/x)$, $\cos(1/x)$, and $\sin(2/x)$ extend continuously to $Y_1$, $Y_2$, and $Y_3$? Where one does, give its value at a point of the remainder.


Write $s = \sin(1/x)$ and $c = \cos(1/x)$.

The pattern: the bigger the remainder, the more functions extend. $Y_3$ takes everything $Y_2$ does and more. But even $Y_3$ refuses $\sin(1/(2x))$: going once around the circle changes $1/x$ by $2\pi$ and $1/(2x)$ by only $\pi$, which flips its sign. There's always another bounded function that wiggles in a new way. Your turn: compute the value of an extension, or notice there isn't one.

Loading practice engine...

So the goal of this page, stated plainly: build one compactification so big that every bounded continuous function extends to it. First we need to know which spaces have a compactification at all.

Completely Regular Spaces

A compactification is compact Hausdorff, and compact Hausdorff spaces have lots of continuous real functions. So a space that sits inside one has lots of them too. The property that captures "lots" is this.

A space $X$ is completely regular if one-point sets are closed in $X$ and, for each point $x_0 \in X$ and each closed set $A$ not containing $x_0$, there is a continuous function $f\colon X \to [0, 1]$ with $f(x_0) = 1$ and $f(A) = \{0\}$.

The function $f$ separates the point from the closed set: it's a little hill that is $1$ at $x_0$ and flat $0$ on all of $A$. In a metric space you can write the hill down.

Show that every metric space $(X, d)$ is completely regular.


One-point sets are closed in a metric space. Let $x_0 \notin A$ with $A$ closed. Then $X \setminus A$ is open, so some ball $B(x_0, \varepsilon)$ misses $A$: every $a \in A$ has $d(a, x_0) \ge \varepsilon$. Let $$f(x) = \max\left\{0, \ 1 - \frac{d(x, x_0)}{\varepsilon}\right\}.$$ It's continuous, since $x \mapsto d(x, x_0)$ is continuous ($|d(x, x_0) - d(y, x_0)| \le d(x, y)$). Its values lie in $[0, 1]$, $f(x_0) = 1 - 0 = 1$, and for $a \in A$, $1 - d(a, x_0)/\varepsilon \le 0$, so $f(a) = 0$.

That's the hill: height $1$ at $x_0$, sloping down to $0$ at distance $\varepsilon$. Drag the point and the closed set around and watch it adjust.

Separate a Point

The closer $x_0$ gets to $A$, the steeper the hill. It never fails, though: as long as $x_0 \notin A$, there's room. Metric spaces aren't the only examples. Here's one that isn't metrizable, with the easiest hill there is.

Show that the lower limit line $\mathbb{R}_l$ is completely regular.


$\mathbb{R}_l$ is finer than the standard topology, so one-point sets are still closed. Let $x_0 \notin A$ with $A$ closed. Since $\mathbb{R}_l \setminus A$ is open and contains $x_0$, it contains a basis element $[x_0, b)$. Let $f$ be $1$ on $[x_0, b)$ and $0$ elsewhere. Its complement $(-\infty, x_0) \cup [b, \infty)$ is a union of basis elements, so $[x_0, b)$ is both open and closed. The preimage of any set under $f$ is one of $\emptyset$, $[x_0, b)$, its complement, or $\mathbb{R}$, all open, so $f$ is continuous. And $f(x_0) = 1$, $f(A) = \{0\}$.

So the hill can be a cliff when the space has sets that are both open and closed. One quick consequence of the definition: completely regular spaces are Hausdorff.

Show that every completely regular space is Hausdorff.

Show proof

Proof. Let $x \neq y$. The set $\{y\}$ is closed and doesn't contain $x$, so there is a continuous $f\colon X \to [0, 1]$ with $f(x) = 1$ and $f(y) = 0$. The sets $f^{-1}\big((\tfrac{1}{2}, 1]\big)$ and $f^{-1}\big([0, \tfrac{1}{2})\big)$ are open (preimages of sets open in $[0, 1]$), disjoint, and contain $x$ and $y$ respectively. $\blacksquare$

Watch the words. Some books (Willard, Engelking) don't include "one-point sets are closed" in "completely regular", and call a completely regular space with closed points a Tychonoff space, or T3½. On this page, following Munkres, "completely regular" already includes closed points, so it is the same as Tychonoff. Also, "regular" is a different, weaker condition (separating a point from a closed set by open sets, not by a function). Every completely regular space is regular, but not the other way around.

Two closure properties make complete regularity easy to check. Building a space from completely regular pieces, by taking subspaces or products, keeps it completely regular.

A subspace of a completely regular space is completely regular. A product of completely regular spaces is completely regular.

Show proof

Proof. Subspaces. Let $Y \subseteq X$. A one-point set $\{y\}$ is closed in $X$, so $\{y\} = Y \cap \{y\}$ is closed in $Y$. Let $A$ be closed in $Y$ with $y_0 \in Y \setminus A$. Then $A = Y \cap \overline{A}$, where $\overline{A}$ is the closure in $X$, so $y_0 \notin \overline{A}$. Choose a continuous $f\colon X \to [0, 1]$ with $f(y_0) = 1$ and $f(\overline{A}) = \{0\}$; its restriction to $Y$ does the job.

Products. Let $X = \prod_{\alpha \in J} X_\alpha$. A point $x = (x_\alpha)$ gives $\{x\} = \bigcap_\alpha \pi_\alpha^{-1}(\{x_\alpha\})$, an intersection of closed sets, so it is closed. Let $A$ be closed with $b \notin A$. Then $X \setminus A$ is open and contains $b$, so it contains a basis element $\prod U_\alpha$ containing $b$, where $U_\alpha = X_\alpha$ except for finitely many indices $\alpha_1, \ldots, \alpha_n$. For each $i$, choose a continuous $f_i\colon X_{\alpha_i} \to [0, 1]$ with $f_i(b_{\alpha_i}) = 1$ and $f_i(X_{\alpha_i} \setminus U_{\alpha_i}) = \{0\}$. Let $$\varphi(x) = f_1\big(\pi_{\alpha_1}(x)\big) \cdot f_2\big(\pi_{\alpha_2}(x)\big) \cdots f_n\big(\pi_{\alpha_n}(x)\big).$$ It is continuous with values in $[0, 1]$, and $\varphi(b) = 1$. If $x \notin \prod U_\alpha$, some coordinate $x_{\alpha_i}$ lies outside $U_{\alpha_i}$, so that factor is $0$ and $\varphi(x) = 0$. Since $A$ lies outside $\prod U_\alpha$, $\varphi(A) = \{0\}$. $\blacksquare$

So $\mathbb{Q}$, $[0, 1]^{\mathbb{R}}$, $\mathbb{R}_l \times \mathbb{R}_l$, and every subspace of them are completely regular. The case that matters most for us is a compact Hausdorff space. That one needs a real tool: Urysohn's lemma, which is proved on the Measure Theory course's Locally Compact Spaces page for every locally compact Hausdorff space.

Every compact Hausdorff space is completely regular.

Show proof

Proof. Let $X$ be compact Hausdorff. One-point sets are closed in a Hausdorff space. $X$ is locally compact, since every point has the neighborhood $X$, whose closure $X$ is compact. Let $A$ be closed with $x_0 \notin A$. The set $K = \{x_0\}$ is compact and lies in the open set $V = X \setminus A$. By Urysohn's lemma there is a continuous $f$ with $0 \le f \le 1$, $f = 1$ on $K$, and $\operatorname{supp} f \subseteq V$. So $f(x_0) = 1$, and $f$ is $0$ outside $V$, that is, on $A$. $\blacksquare$

Urysohn's lemma has a second, more classical form: in a normal space, any two disjoint closed sets can be separated by a function. That version, and the metrization theorem it leads to, live on Urysohn, Tietze & Metrization.

Put the last two theorems together, and every subspace of a compact Hausdorff space is completely regular. So complete regularity is necessary for having a compactification. The next section shows it's also enough. Practice telling the completely regular spaces from the rest first.

Loading practice engine...

Imbedding in a Cube

Here's the big idea. A completely regular space has lots of continuous functions into $[0, 1]$. Use all of them at once as coordinates. That puts $X$ inside a huge cube, $[0, 1]^J$, one copy of $[0, 1]$ for each function. If the cube is compact, the closure of $X$ in it is a compactification. So first: is a product of infinitely many compact spaces compact? Yes, and the nets from the Nets page make the proof short. We need one lemma about products first.

Let $X = \prod_{\alpha \in J} X_\alpha$ have the product topology. A net $\Gamma\colon \mathcal{D} \to X$ converges to $x$ if and only if, for every $\alpha$, the net $\pi_\alpha \circ \Gamma$ converges to $\pi_\alpha(x)$.

Show proof

Proof. ($\implies$) Each projection $\pi_\alpha$ is continuous, and continuous functions carry convergent nets to convergent nets.

($\impliedby$) Let $W$ be an open set containing $x$. It contains a basis element $\prod U_\alpha$ containing $x$, with $U_\alpha = X_\alpha$ except for finitely many indices $\alpha_1, \ldots, \alpha_n$. For each $i$, the net $\pi_{\alpha_i} \circ \Gamma$ is eventually in $U_{\alpha_i}$: there is $\delta_i \in \mathcal{D}$ with $\pi_{\alpha_i}(\Gamma(\delta)) \in U_{\alpha_i}$ whenever $\delta \succeq \delta_i$. Since $\mathcal{D}$ is directed, there is $\delta_0$ with $\delta_0 \succeq \delta_i$ for every $i$. For $\delta \succeq \delta_0$, every coordinate $\alpha_i$ of $\Gamma(\delta)$ lies in $U_{\alpha_i}$, and the other coordinates have no condition. So $\Gamma$ is eventually in $\prod U_\alpha \subseteq W$. $\blacksquare$

In words: convergence in a product is just convergence in every coordinate. That can be very different from convergence in a metric you might have in mind.

In $[0, 1]^{\mathbb{N}}$, let $e_k$ be the point with $1$ in coordinate $k$ and $0$ everywhere else. Does $(e_k)$ converge in the product topology? Does it converge in the uniform metric?


Product topology: fix a coordinate $j$. The $j$th coordinate of $e_k$ is $1$ only when $k = j$, so it is eventually $0$. Every coordinate converges to $0$, so by the lemma $e_k \to (0, 0, 0, \ldots)$.

Uniform metric: $e_k$ is at distance $1$ from $(0, 0, \ldots)$ for every $k$, and $e_j$ and $e_k$ are at distance $1$ from each other for $j \neq k$. No subsequence is Cauchy, so nothing converges.

That's why the product topology is the right one here: it's coarse enough that infinitely many coordinates can't conspire against you. Now the theorem.

On Nets: a space is compact exactly when every universal net in it converges, where a universal net is eventually in $A$ or eventually in $X \setminus A$, for every set $A$. That characterization does all the work below.

Any product of compact spaces is compact.

Show proof

Proof. Let $X = \prod_{\alpha \in J} X_\alpha$ with each $X_\alpha$ compact. It is enough to show that every universal net $\Gamma$ in $X$ converges.

Fix $\alpha$. The net $\pi_\alpha \circ \Gamma$ is universal in $X_\alpha$: for $B \subseteq X_\alpha$, $\Gamma$ is eventually in $\pi_\alpha^{-1}(B)$ or eventually in its complement $\pi_\alpha^{-1}(X_\alpha \setminus B)$, so $\pi_\alpha \circ \Gamma$ is eventually in $B$ or eventually in $X_\alpha \setminus B$. Since $X_\alpha$ is compact, $\pi_\alpha \circ \Gamma$ converges to some $y_\alpha \in X_\alpha$.

Let $y = (y_\alpha)_{\alpha \in J}$. Every coordinate net of $\Gamma$ converges to the matching coordinate of $y$, so $\Gamma$ converges to $y$ by the lemma. $\blacksquare$

The proof is short because the hard part is hidden elsewhere: every net has a universal subnet, which needs Zorn's lemma, and a space is compact exactly when its universal nets converge. Both are proved on Tychonoff's Theorem, along with a second proof that uses no nets. (Choosing all the limits $y_\alpha$ at once uses the axiom of choice, too.) Without some form of choice, Tychonoff's theorem can't be proved, and it's in fact equivalent to the axiom of choice. In particular, the cube $[0, 1]^J$ is compact for every index set $J$, and Hausdorff, since products of Hausdorff spaces are. Now the cube itself.

Let $X$ be completely regular, and let $J = C(X, [0, 1])$ be the set of continuous functions $X \to [0, 1]$. The map $$e\colon X \to [0, 1]^J, \qquad e(x) = \big(f(x)\big)_{f \in J}$$ is an imbedding.

Show proof

Proof. Continuous. The $f$th coordinate of $e$ is $f$, which is continuous, and a map into a product is continuous when each coordinate is.

Injective. If $x \neq y$, then $\{y\}$ is closed and doesn't contain $x$, so some $f \in J$ has $f(x) = 1$ and $f(y) = 0$. Then $e(x)$ and $e(y)$ differ in the $f$th coordinate.

Open onto its image. Let $U \subseteq X$ be open and $z_0 = e(x_0)$ with $x_0 \in U$. Since $X \setminus U$ is closed and misses $x_0$, there is $f \in J$ with $f(x_0) = 1$ and $f(X \setminus U) = \{0\}$. Let $V = \pi_f^{-1}\big((0, 1]\big)$, an open set of the cube, and $W = V \cap e(X)$, open in $e(X)$. Then $z_0 \in W$, since $\pi_f(z_0) = f(x_0) = 1$. And $W \subseteq e(U)$: if $e(x) \in W$, then $f(x) > 0$, so $x \in U$. Every point of $e(U)$ has such a $W$ around it, so $e(U)$ is open in $e(X)$. $\blacksquare$

Notice where complete regularity got used: twice, once to separate points, once to separate a point from a closed set. You don't always need every function. Even two coordinates already give a compactification, just a smaller one.

Let $X = (0, 1]$, and use only the two functions $f_1(x) = x$ and $f_2(x) = \frac{1}{2}\big(1 + \sin(1/x)\big)$, both continuous into $[0, 1]$. Describe the closure of the image of $x \mapsto \big(f_1(x), f_2(x)\big)$ in the square $[0, 1]^2$.


The map is an imbedding, because its first coordinate is $x$ itself. Its image is the topologist's sine curve squeezed into the square: $\sin(1/x)$ scaled from $[-1, 1]$ to $[0, 1]$. The closure adds the segment $\{0\} \times [0, 1]$, exactly as for $Y_2$. So two functions rebuild $Y_2$, with $f_1$ alone giving $Y_1$. Adding the third function $\frac{1}{2}(1 + \cos(1/x))$ would rebuild $Y_3$.

Each function you add as a coordinate can only split the remainder further: points of the closure that agreed in the old coordinates may disagree in the new one. Watch a point grow into a segment, then a circle.

The cube imbedding uses every function, so it should give the biggest remainder of all. One general fact first: an imbedding into any compact Hausdorff space gives a compactification.

Let $h\colon X \to Z$ be an imbedding of $X$ into a compact Hausdorff space $Z$. Then $\overline{h(X)}$ is a compactification of $X$ (after identifying $X$ with $h(X)$).

Show proof

Proof. $\overline{h(X)}$ is a closed subspace of a compact space, so it is compact, and a subspace of a Hausdorff space, so it is Hausdorff. It contains $h(X)$, a homeomorphic copy of $X$, and the closure of $h(X)$ in $\overline{h(X)}$ is all of $\overline{h(X)}$. $\blacksquare$

Now we can say exactly which spaces have compactifications.

A space $X$ has a compactification if and only if $X$ is completely regular.

Show proof

Proof. ($\implies$) If $Y$ is a compactification of $X$, then $Y$ is compact Hausdorff, hence completely regular, and $X$ is a subspace of $Y$, hence completely regular.

($\impliedby$) The cube $[0, 1]^J$ is compact by Tychonoff's theorem and Hausdorff as a product of Hausdorff spaces, and $e$ is an imbedding into it. By the lemma, $\overline{e(X)}$ is a compactification of $X$. $\blacksquare$

A space that fails the test has nowhere compact to live.

Does $\mathbb{R}$ with the finite complement topology $\mathcal{T}_f$ have a compactification? It is compact already, so why not itself?


A compactification has to be Hausdorff, and so does every subspace of one. In $\mathcal{T}_f$, two nonempty open sets $\mathbb{R} \setminus E$ and $\mathbb{R} \setminus E'$ always meet (their complements are finite, so they can't cover $\mathbb{R}$). So $\mathcal{T}_f$ isn't Hausdorff, hence not completely regular, and by the theorem it has no compactification. Being compact isn't enough: the space itself fails the Hausdorff test.

Meanwhile $\mathbb{Q}$, $\mathbb{R}_l$, and every metric space do have compactifications. The one the proof builds is the star of the page.

The Biggest Compactification

Let $X$ be completely regular and $e\colon X \to [0, 1]^{C(X, [0, 1])}$ the imbedding $e(x) = \big(f(x)\big)_f$. The Stone–Čech compactification $\beta X$ of $X$ is the closure of $e(X)$ in $[0, 1]^{C(X, [0, 1])}$, with $X$ identified with $e(X)$.

The definition is concrete but enormous: $\beta X$ lives in a product with one factor for every continuous function on $X$. Luckily, we'll almost never use the definition directly. Everything comes from one property. First, a sanity check on a space that's already compact.

Show that $\beta X = X$ when $X$ is compact Hausdorff.


$X$ is completely regular, so $\beta X$ is defined. The image $e(X)$ is compact, as a continuous image of a compact space, and a compact subspace of the Hausdorff cube is closed. So $\beta X = \overline{e(X)} = e(X)$, which is $X$ after the identification. The remainder is empty.

Conversely, if $X$ is not compact, the remainder $\beta X \setminus X$ can't be empty, since $\beta X$ is compact. Now the key lemma. Each coordinate of the cube is one of the functions on $X$, so each function is already sitting there, waiting to be extended.

Let $X$ be completely regular. Every continuous $f\colon X \to [0, 1]$ extends to a continuous $F\colon \beta X \to [0, 1]$. More generally, every continuous $f\colon X \to [a, b]$ extends to a continuous $F\colon \beta X \to [a, b]$.

Show proof

Proof. Let $f \in C(X, [0, 1])$, and let $F$ be the projection $\pi_f$ onto the $f$th coordinate, restricted to $\beta X$. It is continuous, and for $x \in X$, $F(x) = \pi_f(e(x)) = f(x)$. For $f\colon X \to [a, b]$ with $a < b$, the function $g = (f - a)/(b - a)$ maps into $[0, 1]$; extend it to $G$ and let $F = a + (b - a)G$. (If $a = b$, $f$ is constant and so is $F$.) $\blacksquare$

Extensions are also unique, for a reason that has nothing to do with $\beta X$: a continuous map into a Hausdorff space is determined by its values on a dense set.

Let $f, g\colon Y \to Z$ be continuous, with $Z$ Hausdorff. If $f = g$ on a dense subset $D$ of $Y$, then $f = g$.

Show proof

Proof. Suppose $f(y) \neq g(y)$ for some $y$. Since $Z$ is Hausdorff, there are disjoint open sets $U \ni f(y)$ and $V \ni g(y)$. The set $W = f^{-1}(U) \cap g^{-1}(V)$ is open and contains $y$. Since $D$ is dense, $W$ contains a point $d \in D$. Then $f(d) \in U$ and $g(d) \in V$, but $f(d) = g(d)$, contradicting $U \cap V = \emptyset$. $\blacksquare$

You've used this lemma before without the name.

Let $f, g\colon \mathbb{R} \to \mathbb{R}$ be continuous with $f(q) = g(q)$ for every rational $q$. Show that $f = g$.


$\mathbb{Q}$ is dense in $\mathbb{R}$ and $\mathbb{R}$ is Hausdorff, so the lemma applies. Directly: for any $x$, pick rationals $q_k \to x$. Then $f(x) = \lim f(q_k) = \lim g(q_k) = g(x)$ by continuity. That's the same argument in sequence form.

Watch what Hausdorff buys. Take the line with two origins: $\mathbb{R}$ with $0$ replaced by two points $0_a$ and $0_b$, each with the neighborhoods $\{0_i\} \cup (-\varepsilon, 0) \cup (0, \varepsilon)$. The identity and the map that swaps the two origins are continuous, agree on the dense set $\mathbb{R} \setminus \{0\}$, and still differ. Now the main theorem. The interval $[0, 1]$ is not special; any compact Hausdorff target works.

Let $X$ be completely regular, $K$ compact Hausdorff, and $f\colon X \to K$ continuous. There is a unique continuous $\beta f\colon \beta X \to K$ with $\beta f(x) = f(x)$ for every $x \in X$.

Show proof

Proof. Existence. $K$ is completely regular, so it has its own cube imbedding $e_K\colon K \to [0, 1]^{J_K}$, with $J_K = C(K, [0, 1])$. Since $K$ is compact, $e_K(K)$ is compact, hence closed in the cube.

For each $g \in J_K$, the composite $g \circ f$ is in $C(X, [0, 1])$, so by the lemma it extends to a continuous $G_g\colon \beta X \to [0, 1]$. Define $$\Phi\colon \beta X \to [0, 1]^{J_K}, \qquad \Phi(p) = \big(G_g(p)\big)_{g \in J_K}.$$ It is continuous, because each coordinate is. For $x \in X$, $\Phi(x) = \big(g(f(x))\big)_g = e_K(f(x))$, so $\Phi(X) \subseteq e_K(K)$. Since $X$ is dense in $\beta X$ and $\Phi$ is continuous, $$\Phi(\beta X) = \Phi(\overline{X}) \subseteq \overline{\Phi(X)} \subseteq e_K(K),$$ using that $e_K(K)$ is closed. Now $e_K$ is a homeomorphism onto $e_K(K)$, so $\beta f = e_K^{-1} \circ \Phi$ is a continuous map $\beta X \to K$, and $\beta f(x) = e_K^{-1}(e_K(f(x))) = f(x)$ for $x \in X$.

Uniqueness. Two such extensions agree on the dense set $X$ and map into the Hausdorff space $K$, so they are equal by the lemma. $\blacksquare$

This is the property people mean when they say "Stone–Čech". Every map from $X$ into a compact Hausdorff space extends, uniquely, through $\beta X$. Here it is on a map that wraps around forever.

Let $X = (0, 1]$ and $f\colon X \to S^1$, $f(x) = (\cos(1/x), \sin(1/x))$. Show that the extension $\beta f\colon \beta X \to S^1$ maps the remainder $\beta X \setminus X$ onto all of $S^1$.


Fix $z = (\cos\theta, \sin\theta)$ and let $x_j = 1/(\theta + 2\pi j)$ for $j$ large enough that $x_j \le 1$, so $f(x_j) = z$ and $x_j \to 0$. Let $C_k$ be the closure in $\beta X$ of $\{x_j : j \ge k\}$. These are nonempty closed sets, each inside the one before, so every finite collection of them has nonempty intersection, and since $\beta X$ is compact there is a point $p \in \bigcap_k C_k$.

$\beta f$ is continuous and equals $z$ on each $\{x_j : j \ge k\}$, so it equals $z$ on $C_k$, and $\beta f(p) = z$. And $p \notin X$: the closure of $\{x_j : j \ge k\}$ in $X$ is the set itself (the $x_j$ head to $0$, which isn't in $X$), and no point of $X$ lies in all of those sets. So $z$ is the image of a point of the remainder.

So the whole circle's worth of behavior near $0$ lives in the remainder of $\beta X$. And the universal property pins $\beta X$ down completely.

Let $Y$ be a compactification of the completely regular space $X$ such that every continuous map from $X$ into a compact Hausdorff space extends continuously to $Y$. Then $Y$ is equivalent to $\beta X$.

Show proof

Proof. The inclusion $X \to \beta X$ is a continuous map into a compact Hausdorff space, so by the hypothesis on $Y$ it extends to a continuous $F\colon Y \to \beta X$. The inclusion $X \to Y$ extends, by the universal property of $\beta X$, to a continuous $G\colon \beta X \to Y$. Both are the identity on $X$.

Then $G \circ F\colon Y \to Y$ is continuous and equals the identity on the dense set $X$, so $G \circ F = \operatorname{id}_Y$ by the lemma. Likewise $F \circ G = \operatorname{id}_{\beta X}$. So $F$ is a homeomorphism with inverse $G$, and $F(x) = x$ for $x \in X$. $\blacksquare$

So the giant cube was just scaffolding. Any compactification with the universal property is $\beta X$, however it was built. ($\beta\mathbb{N}$, for example, is often built from ultrafilters instead.) And "biggest" really means biggest: every compactification of $X$ is an image of $\beta X$.

Let $Y$ be any compactification of $X$. There is a continuous surjection $\beta X \to Y$ that is the identity on $X$.

Show proof

Proof. The inclusion $j\colon X \to Y$ is continuous and $Y$ is compact Hausdorff, so it extends to a continuous $F = \beta j\colon \beta X \to Y$ with $F(x) = x$ on $X$. The image $F(\beta X)$ is compact, so it is closed in the Hausdorff space $Y$. It contains $X$, so it contains $\overline{X} = Y$. $\blacksquare$

On Compact Spaces: a compact subspace of a Hausdorff space is closed. That one fact closed up three proofs on this page: $\beta X = X$ for compact $X$, the universal property, and this one.

For compactifications you can draw, you can often write the squashing map down.

Find a continuous surjection from the spiral $Y_3$ onto the sine curve $Y_2$ that is the identity on $X = (0, 1]$.


A point of $X$ sits in $Y_3$ as $p = (1 + x)(\cos(1/x), \sin(1/x))$ and in $Y_2$ as $(x, \sin(1/x))$. From $p = (p_1, p_2)$ we can read off $x = |p| - 1$ and $\sin(1/x) = p_2 / |p|$. So let $$G(p) = \left(|p| - 1, \ \frac{p_2}{|p|}\right),$$ continuous wherever $p \neq 0$, which includes all of $Y_3$. It sends each point of $X$ to itself, and it sends the remainder point $(\cos\theta, \sin\theta)$ to $(0, \sin\theta)$, so the circle wraps onto the segment $\{0\} \times [-1, 1]$, two points to one (except at the ends). The image is all of $Y_2$.

The surjection $F$ squashes each piece of the big remainder onto a point of the small one. For $Y_1 = [0, 1]$ and $X = (0, 1]$, all of $\beta X \setminus X$ gets squashed to the single point $0$. In particular, $Y_1$ isn't $\beta X$, and neither is $Y_2$ or $Y_3$.

Show that $[0, 1]$ is not equivalent to $\beta(0, 1]$.

Show proof

Proof. The function $f(x) = \sin(1/x)$ maps $(0, 1]$ continuously into the compact Hausdorff space $[-1, 1]$, so it extends to $\beta f\colon \beta(0, 1] \to [-1, 1]$. Suppose $h\colon [0, 1] \to \beta(0, 1]$ were a homeomorphism with $h(x) = x$ on $(0, 1]$. Then $\beta f \circ h$ would be a continuous function on $[0, 1]$ equal to $\sin(1/x)$ on $(0, 1]$, so $\sin(1/x)$ would have the limit $\beta f(h(0))$ as $x \to 0$. It doesn't: it equals $1$ at $x = 1/(\frac{\pi}{2} + 2\pi k)$ and $-1$ at $x = 1/(\frac{3\pi}{2} + 2\pi k)$, and both go to $0$. $\blacksquare$

For real-valued functions, the universal property says something you can use every day. Write $C_b(X)$ for the bounded continuous functions $X \to \mathbb{R}$.

Let $X$ be completely regular. Every $f \in C_b(X)$ extends uniquely to a continuous function on $\beta X$, and restriction $F \mapsto F|_X$ is a bijection from the continuous functions $\beta X \to \mathbb{R}$ onto $C_b(X)$.

Show proof

Proof. A continuous $F\colon \beta X \to \mathbb{R}$ has a compact, hence bounded, image, so $F|_X$ is in $C_b(X)$. Given $f \in C_b(X)$ with $|f| \le M$, the lemma extends $f\colon X \to [-M, M]$ to $\beta X$, so restriction is onto. Two continuous functions on $\beta X$ with the same restriction agree on the dense set $X$, so they are equal; restriction is one-to-one. $\blacksquare$

So $C_b(X)$ and the continuous functions on the compact Hausdorff space $\beta X$ are the same thing. The Riesz Representation theorem turns positive linear functionals on continuous functions on a compact space into measures. Through $\beta X$, functionals on $C_b(X)$ become measures on $\beta X$, even when $X$ itself has no room for them.

Every compactification of $X$ is a squashed copy of $\beta X$. So the one compactification nobody can draw is the one all the others come from. Classic hoarder behavior.

Meeting $\beta\mathbb{N}$

Give $\mathbb{N}$ the discrete topology, the one it has as a subspace of $\mathbb{R}$. It's metrizable, so completely regular, and every function on it is continuous. A bounded function on $\mathbb{N}$ is just a bounded sequence $(a_n)$. So the corollary says: every bounded sequence extends continuously to $\beta\mathbb{N}$. That gives every point of $\beta\mathbb{N}$ a way to take a "limit" of a sequence.

Let $p \in \beta\mathbb{N}$ and let $(a_n)$ be a bounded sequence of real numbers. The limit of $(a_n)$ along $p$ is $$p\text{-}\lim a_n = \beta a(p),$$ where $\beta a\colon \beta\mathbb{N} \to \mathbb{R}$ is the continuous extension of $n \mapsto a_n$.

At a point $p = m$ of $\mathbb{N}$ itself, $p\text{-}\lim a_n = a_m$, which is boring. The interesting points are the ones in the remainder $\beta\mathbb{N} \setminus \mathbb{N}$, the points at infinity. To compute anything there, we need to know how a point at infinity sits relative to subsets of $\mathbb{N}$. Here closures are taken in $\beta\mathbb{N}$.

Let $A, B \subseteq \mathbb{N}$ and $p \in \beta\mathbb{N}$.

  1. $p$ lies in exactly one of $\overline{A}$ and $\overline{\mathbb{N} \setminus A}$.
  2. $\overline{A \cap B} = \overline{A} \cap \overline{B}$.
Show proof

Proof. (a) The closure of a finite union is the union of the closures, so $\overline{A} \cup \overline{\mathbb{N} \setminus A} = \overline{\mathbb{N}} = \beta\mathbb{N}$, and $p$ lies in at least one. Let $\chi_A$ be $1$ on $A$ and $0$ on $\mathbb{N} \setminus A$, and $F = \beta\chi_A\colon \beta\mathbb{N} \to [0, 1]$. The set $F^{-1}(\{1\})$ is closed and contains $A$, so it contains $\overline{A}$; likewise $F^{-1}(\{0\}) \supseteq \overline{\mathbb{N} \setminus A}$. So $F = 1$ on $\overline{A}$ and $F = 0$ on $\overline{\mathbb{N} \setminus A}$, and the two closures are disjoint.

(b) $A \cap B$ lies in $A$ and in $B$, so $\overline{A \cap B} \subseteq \overline{A} \cap \overline{B}$. Conversely, let $p \in \overline{A} \cap \overline{B}$ and suppose $p \notin \overline{A \cap B}$. By (a), $p$ lies in $$\overline{\mathbb{N} \setminus (A \cap B)} = \overline{(\mathbb{N} \setminus A) \cup (\mathbb{N} \setminus B)} = \overline{\mathbb{N} \setminus A} \cup \overline{\mathbb{N} \setminus B}.$$ But $p \in \overline{A}$, so by (a) $p \notin \overline{\mathbb{N} \setminus A}$; likewise $p \notin \overline{\mathbb{N} \setminus B}$. Contradiction. $\blacksquare$

Apply it twice and the choices refine each other.

Let $p$ lie in the closure of the even numbers. Show that $p$ lies in the closure of exactly one of $\{n \equiv 0 \pmod{4}\}$ and $\{n \equiv 2 \pmod{4}\}$.


Let $A$ be the multiples of $4$ and $E$ the evens. By (a), $p$ lies in exactly one of $\overline{A}$ and $\overline{\mathbb{N} \setminus A}$. If $p \in \overline{A}$, we're done, and $p \notin \overline{E \setminus A}$, since $E \setminus A \subseteq \mathbb{N} \setminus A$. Otherwise $p \in \overline{\mathbb{N} \setminus A} \cap \overline{E}$, which equals $\overline{(\mathbb{N} \setminus A) \cap E}$ by (b), the closure of $\{n \equiv 2 \pmod{4}\}$.

So a point of $\beta\mathbb{N}$ makes up its mind about every subset of $\mathbb{N}$: it's near $A$ or near the rest, never both. Every point at infinity is near the evens or near the odds, near exactly one residue class mod $3$, and so on. That's all you need to compute limits along it.

Let $(a_n)$ and $(b_n)$ be bounded sequences and $p \in \beta\mathbb{N}$.

  1. If $p \in \overline{A}$ for some $A \subseteq \mathbb{N}$, and $a_n = c$ for every $n \in A$, then $p\text{-}\lim a_n = c$.
  2. If $a_n \to L$ and $p \in \beta\mathbb{N} \setminus \mathbb{N}$, then $p\text{-}\lim a_n = L$.
  3. $p\text{-}\lim (a_n + b_n) = p\text{-}\lim a_n + p\text{-}\lim b_n$.
Show proof

Proof. (a) $\beta a^{-1}(\{c\})$ is closed and contains $A$, so it contains $\overline{A} \ni p$.

(b) Let $\varepsilon > 0$. There is a finite set $E \subseteq \mathbb{N}$ with $|a_n - L| \le \varepsilon$ for $n \notin E$. The finite set $E$ is closed in the Hausdorff space $\beta\mathbb{N}$, so $\overline{E} = E \subseteq \mathbb{N}$ doesn't contain $p$. By the previous theorem, $p \in \overline{\mathbb{N} \setminus E}$. The set $\beta a^{-1}([L - \varepsilon, L + \varepsilon])$ is closed and contains $\mathbb{N} \setminus E$, so it contains $p$: $|\beta a(p) - L| \le \varepsilon$. This holds for every $\varepsilon$, so $\beta a(p) = L$.

(c) $\beta(a + b)$ and $\beta a + \beta b$ are continuous maps $\beta\mathbb{N} \to \mathbb{R}$ that agree on the dense set $\mathbb{N}$, so they are equal. $\blacksquare$

Rule (b) says limits along $p$ extend ordinary limits: a convergent sequence has the same limit along every point at infinity. Rule (a) handles sequences that don't converge. Watch the simplest one, $(-1)^n$.

The sequence $(-1)^n$ has no limit, yet it has a limit along every point at infinity, and the answer depends only on which side of evens and odds the point picked. Put the three rules together.

Let $p \in \beta\mathbb{N} \setminus \mathbb{N}$ lie in the closure of the even numbers and in the closure of the multiples of $3$. Find $p\text{-}\lim a_n$ for $a_n = (-1)^n + \cos\frac{2\pi n}{3} + \frac{5}{n}$.


By part (b) of the first theorem, $p$ lies in the closure of $\{\text{evens}\} \cap \{\text{multiples of } 3\}$, the multiples of $6$. On that set, $(-1)^n = 1$ and $\cos\frac{2\pi n}{3} = 1$. So by rule (a), $p\text{-}\lim (-1)^n = 1$ and $p\text{-}\lim \cos\frac{2\pi n}{3} = 1$. By rule (b), $p\text{-}\lim \frac{5}{n} = 0$, since $\frac{5}{n} \to 0$. By rule (c), $$p\text{-}\lim a_n = 1 + 1 + 0 = 2.$$

Notice what you didn't get: the average, the limsup, or the value at some particular $n$. A point at infinity picks one residue class and reads the sequence there. Pick sides yourself and see which limits get pinned down.

Choose a Point at Infinity

Residue classes pin down every periodic sequence, but $\sin n$ never settles: it isn't constant on any residue class. A point of $\beta\mathbb{N}$ has to choose a side of every subset of $\mathbb{N}$, including ones like $\{n : \sin n > 0\}$, and no finite list of choices finishes the job. Your turn to compute.

Loading practice engine...

For $p \in \beta\mathbb{N}$, the collection $\{A \subseteq \mathbb{N} : p \in \overline{A}\}$ is closed under finite intersections and supersets, and contains exactly one of $A$ and $\mathbb{N} \setminus A$ for every $A$: it's an ultrafilter. Every ultrafilter on $\mathbb{N}$ comes from exactly one point this way, so $\beta\mathbb{N}$ is often defined as the set of ultrafilters on $\mathbb{N}$. A universal net from the Nets page is the same idea: it, too, decides "eventually in $A$ or eventually out" for every set.

How big is the remainder? At least two points: the closure of the evens and the closure of the odds each contain a point at infinity, and they're disjoint.

Let $E$ be the even numbers. Show that $\overline{E}$ contains a point of $\beta\mathbb{N} \setminus \mathbb{N}$. Conclude that $\beta\mathbb{N} \setminus \mathbb{N}$ has at least two points, and that $\beta\mathbb{N}$ is not equivalent to the one-point compactification $\{0\} \cup \{\frac{1}{n} : n \in \mathbb{N}\}$ (with $n$ identified with $\frac{1}{n}$).

Show proof

Proof. First, $\overline{E} \cap \mathbb{N} = E$: an odd $m$ lies in $\overline{\mathbb{N} \setminus E}$, so by the picks-a-side theorem it is not in $\overline{E}$. If $\overline{E}$ had no points at infinity, then $\overline{E} = E$, a closed subset of the compact space $\beta\mathbb{N}$, hence compact. But $E$ is an infinite discrete space, and the open cover by its one-point sets has no finite subcover. So $\overline{E}$ contains some $p \in \beta\mathbb{N} \setminus \mathbb{N}$. The same argument gives $q$ at infinity in the closure of the odds, and $p \neq q$ because the two closures are disjoint.

The one-point compactification has a one-point remainder, and an equivalence would map remainders bijectively onto each other. (Or: $(-1)^n$ extends to $\beta\mathbb{N}$ but has no limit as $\frac{1}{n} \to 0$.) $\blacksquare$

The same argument with residue classes mod $m$ gives at least $m$ points at infinity, for every $m$, so the remainder is infinite. In fact $\beta\mathbb{N}$ has $2^{\mathfrak{c}}$ points, more than $\mathbb{R}$ has, though that takes more work. You can watch the remainder of a smaller compactification of $\mathbb{N}$ grow as you add sequences as coordinates.

Compactify $\mathbb{N}$

Every compactification there is a squashed $\beta\mathbb{N}$, and $\beta\mathbb{N}$ splits the remainder by every bounded sequence at once.

$\beta\mathbb{N}$ has $2^{\mathfrak{c}}$ points, and nobody can write down a single one of the new ones. Not one. Their existence needs a piece of the axiom of choice. Rude.

Now some structure. The points of $\mathbb{N}$ stay isolated inside $\beta\mathbb{N}$, even though they pile up at infinity.

For every $n \in \mathbb{N}$, the set $\{n\}$ is open in $\beta\mathbb{N}$. So $\mathbb{N}$ is open in $\beta\mathbb{N}$, and the remainder $\beta\mathbb{N} \setminus \mathbb{N}$ is compact.

Show proof

Proof. By the picks-a-side theorem with $A = \{n\}$, $\beta\mathbb{N}$ is the disjoint union of $\overline{\{n\}}$ and $\overline{\mathbb{N} \setminus \{n\}}$. One-point sets are closed in the Hausdorff space $\beta\mathbb{N}$, so $\overline{\{n\}} = \{n\}$, and $\{n\} = \beta\mathbb{N} \setminus \overline{\mathbb{N} \setminus \{n\}}$ is open. Then $\mathbb{N}$ is a union of open sets, so the remainder is closed in the compact space $\beta\mathbb{N}$, hence compact. $\blacksquare$

So $\beta\mathbb{N}$ is compact, and it's full of sequences: $1, 2, 3, \ldots$ is one. You'd expect a subsequence to converge somewhere. None does.

No subsequence of the sequence $(n)_{n \in \mathbb{N}}$ converges in $\beta\mathbb{N}$. So $\beta\mathbb{N}$ is compact but not sequentially compact, and not metrizable.

Show proof

Proof. Suppose a subsequence $n_1 < n_2 < n_3 < \cdots$ converges to $p \in \beta\mathbb{N}$. Let $A = \{n_k : k \text{ even}\}$ and $F = \beta\chi_A$. Then $F(n_k)$ is $1$ for even $k$ and $0$ for odd $k$, since the $n_k$ are distinct. But $F$ is continuous, so $F(n_k) \to F(p)$, and the sequence $0, 1, 0, 1, \ldots$ doesn't converge. Contradiction.

So $\beta\mathbb{N}$ is not sequentially compact. A compact metrizable space is sequentially compact, so $\beta\mathbb{N}$ is not metrizable. $\blacksquare$

Here's the proof as a picture: the extension of the alternating indicator has to be $1$ and $0$ arbitrarily close to $p$, so it can't be continuous there.

A place where every bounded sequence gets a limit at every point at infinity, and not a single sequence of new points converges. My analysis professor needs to sit down.

Mixed Practice

Every question so far came right after its idea, which is a hint. Down here the hint is gone. First, true or false: a claim about anything on this page, some of them the kind that sounds right and isn't. Decide, then read why.

Loading practice engine...

Then a proof from this page with one line to fill in. Every wrong line is false or doesn't follow.

Loading practice engine...

Next, the mixed set. Every question type on this page except true or false goes into one hat, and each click draws a new one at random. Flip the switch to type your answer; a few types need their answer choices, and they'll say so.

Loading practice engine...

Spicy Bonus

Last, the Spicy Bonus. We showed the sequence $1, 2, 3, \ldots$ has no convergent subsequence. Push the same trick all the way: in $\beta\mathbb{N}$, the only sequences that converge are the ones that are eventually constant.

🌶️ SPICY BONUS 🌶️

Let $(x_k)$ be a sequence in $\beta\mathbb{N}$ that converges to $p$. Prove that $x_k = p$ for all but finitely many $k$.

Show proof

Proof. Suppose not. Then infinitely many terms differ from $p$, and they form a subsequence that still converges to $p$. If some value $q \neq p$ appeared in it infinitely often, those terms would form a constant subsequence converging both to $q$ and to $p$, impossible in a Hausdorff space. So we can pass to a further subsequence and assume the $x_k$ are distinct and all different from $p$.

Disjoint neighborhoods. Choose disjoint open sets $U_1 \ni x_1$ and $V_1 \ni p$. All but finitely many $x_k$ lie in $V_1$, so pass to a subsequence (keeping $x_1$) whose later terms all lie in $V_1$. Choose disjoint open sets $U_2 \ni x_2$ and $V_2 \ni p$, both inside $V_1$, and pass to a subsequence whose terms after $x_2$ lie in $V_2$. Continuing, we get open sets $U_k \ni x_k$ and $V_k \ni p$ with $U_k \cap V_k = \emptyset$, $V_k \subseteq V_{k-1}$, and $U_k \subseteq V_{k-1}$. For $j > k$, $U_j \subseteq V_{j-1} \subseteq V_k$, which misses $U_k$. So the $U_k$ are pairwise disjoint, and the new sequence is a subsequence of the old one, so it still converges to $p$.

Trace on $\mathbb{N}$. Let $A_k = U_k \cap \mathbb{N}$. These are pairwise disjoint, and $x_k \in \overline{A_k}$: if $W$ is open and contains $x_k$, then $W \cap U_k$ is a nonempty open set, so it meets the dense set $\mathbb{N}$, that is, $W$ meets $A_k$.

The alternating indicator. Let $A = \bigcup_{k \text{ even}} A_k$ and $F = \beta\chi_A$. For even $k$, $A_k \subseteq A$, so $F = 1$ on $\overline{A_k} \ni x_k$. For odd $k$, $A_k$ misses $A$ (the $A_k$ are disjoint), so $F = 0$ on $A_k$, hence on $\overline{A_k} \ni x_k$. So $F(x_k)$ alternates between $0$ and $1$. But $F$ is continuous and $x_k \to p$, so $F(x_k) \to F(p)$. Contradiction. $\blacksquare$