[proofplan]
We prove compactness directly from the open-cover definition. Given an [open cover](/page/Open%20Cover), the empty space is handled by the empty subcover. Otherwise, one [open set](/page/Open%20Set) from the cover already covers all but finitely many points, and each remaining point can be covered by one additional member of the cover. The union of these finitely many chosen open sets is therefore all of $X$.
[/proofplan]
[step:Handle the empty space by the empty subcover]
Let $(U_i)_{i\in I}$ be an open cover of $X$ by sets in $\tau_{\mathrm{cof}}$, where $I$ is an index set. If $X=\varnothing$, then the subfamily indexed by the empty subset of $I$ has union $\varnothing=X$, so it is a finite subcover. Hence assume for the rest of the proof that $X\neq\varnothing$.
[/step]
[step:Choose one cover element whose complement is finite]
Since $X\neq\varnothing$, choose a point $x_0\in X$. Because $(U_i)_{i\in I}$ covers $X$, there exists an index $i_0\in I$ such that $x_0\in U_{i_0}$. In particular, $U_{i_0}\neq\varnothing$. Since $U_{i_0}\in\tau_{\mathrm{cof}}$ and the only open set in the definition of $\tau_{\mathrm{cof}}$ not required to have finite complement is $\varnothing$, the set
\begin{align*}
F:=X\setminus U_{i_0}
\end{align*}
is finite.
[guided]
We begin with an arbitrary open cover because compactness is exactly the assertion that every such cover has a finite subcover. Thus let $(U_i)_{i\in I}$ be an open cover of $X$, meaning that each $U_i$ belongs to $\tau_{\mathrm{cof}}$ and
\begin{align*}
X=\bigcup_{i\in I}U_i.
\end{align*}
Since we are now in the case $X\neq\varnothing$, choose a point $x_0\in X$. The cover condition says that $x_0$ belongs to at least one member of the cover, so there is an index $i_0\in I$ with $x_0\in U_{i_0}$. This matters because it guarantees $U_{i_0}\neq\varnothing$.
By the definition of the [cofinite topology](/page/Cofinite%20Topology),
\begin{align*}
\tau_{\mathrm{cof}}=\{\varnothing\}\cup\{U\subset X:X\setminus U\text{ is finite}\}.
\end{align*}
Since $U_{i_0}\in\tau_{\mathrm{cof}}$ and $U_{i_0}$ is not empty, it must belong to the second part of this union. Therefore the complement
\begin{align*}
F:=X\setminus U_{i_0}
\end{align*}
is a finite subset of $X$. This is the key cofinite-topology observation: one nonempty open set already covers all points except those in the finite set $F$.
[/guided]
[/step]
[step:Cover the finite complement by finitely many additional members]
For each point $y\in F$, the cover property gives an index $i_y\in I$ such that $y\in U_{i_y}$. Define the finite index set
\begin{align*}
J:=\{i_0\}\cup\{i_y:y\in F\}\subset I.
\end{align*}
The set $J$ is finite because it is the union of a singleton with the image of the finite set $F$ under the assignment $y\mapsto i_y$.
[/step]
[step:Verify that the selected finite subfamily covers $X$]
We claim that $(U_j)_{j\in J}$ covers $X$. Let $x\in X$. If $x\in U_{i_0}$, then $x$ belongs to the union of the selected subfamily. If $x\notin U_{i_0}$, then $x\in X\setminus U_{i_0}=F$, so by the choice of $i_x$ we have $x\in U_{i_x}$ and $i_x\in J$. Hence every $x\in X$ lies in some $U_j$ with $j\in J$, and therefore
\begin{align*}
X=\bigcup_{j\in J}U_j.
\end{align*}
Thus every open cover of $(X,\tau_{\mathrm{cof}})$ has a finite subcover, so $(X,\tau_{\mathrm{cof}})$ is compact.
[/step]