Q:

Topology on $\mathbb{Z}\cup\left\{\pm\infty\right\}$

With respect to the discrete topology, $\mathbb{Z}$ is not compact.
Can we equip $\bar{\mathbb{Z}}:=\mathbb{Z}\cup\left\{-\infty,+\infty\right\}$ with some topology which makes $\bar{\mathbb{Z}}$ compact?
(For the extended real line $\bar{\mathbb{R}}:=\mathbb{R}\cup\left\{-\infty,+\infty\right\}$, we can take the topology having basis consisting of all $(a,b)$, $a,b\in\mathbb{R}$ and
$$
[-\infty,a):=\left\{x\in\mathbb{R}: x<a\right\}\cup\left\{-\infty\right\}, a\in\mathbb{R}
$$
and
$$
(a,+\infty]:=\left\{x\in\mathbb{R}: x>a\right\}\cup\left\{+\infty\right\}, a\in\mathbb{R}.
$$
Can we make something similar for $\bar{\mathbb{Z}}$, ie. keep the open sets of the discrete topology and add some local basis for the points $-\infty$ and $+\infty$?)

A:

Yes, just use the topology you mention for $\bar{\mathbb R}$ and give $\bar{\mathbb Z}$  the topology it inherits as a subspace. Note that $\bar{\mathbb Z}$ is then compact, being a closed subset of the compact space $\bar{\mathbb R}$.
It is also easy to see compactness from the fact that any neighborhood (in $\bar{\mathbb Z}$) of the two-point set $\{\infty,-\infty\}$ contains all but a finite number of points of $\bar{\mathbb Z}$.

