Solution (source code)

= Solution
{c}

A subset is <compact> if every cover of it by open sets of the ambient space has a <finite subcover>; equivalently use open sets of its <subspace topology>. A cover of $A\cup B$ separately covers $A$ and $B$. <Compactness> of each supplies two finite collections, whose union is finite and covers $A\cup B$. If $A$ is closed in a <compact> space, add the open complement of $A$ to any <open cover> of $A$. <Compactness> supplies a <finite subcover> of the whole space, and discarding the complement leaves a finite cover of $A$.

For the enlarged space, every old open set is open in $C$ and has the same trace on $X$. The trace on $X$ of a new open set $V\cup\{\infty\}$ is $V$, which is open in $X$ because its complement is closed. Thus the induced topology on $X$ is exactly the original one.

Given an <open cover> of $C$, choose a member containing infinity. It has the form $V\cup\{\infty\}$ with $K=X\setminus V$ <compact>. The remaining cover restricted to $K$ has a <finite subcover>. Together with the chosen infinity-neighborhood, these finitely many sets cover $C$. Hence \b[$C$ is <compact>], with no <Hausdorff> assumption needed.

Finally put $a=f(\infty)$. <Continuity> makes $U=f^{-1}((a-\epsilon,a+\epsilon))$ open and containing infinity. Therefore $U=V\cup\{\infty\}$ with $W=X\setminus V$ <compact> and closed in $X$. For every $x\in X\setminus W=V$ we have
$$
\boxed{|f(x)-a|<\epsilon.}
$$
This expresses convergence to the value at infinity outside <compact> closed subsets.