In Hatcher's Algebraic topology p.520 he gives the following proposition and proof about CW-complexes which I'll copy partially for clarity sake.
Propostion A.1: A compact subspace of a CW complex is contained in a finite subcomplex.
Proof: First we show that a compact set $C$ in a CW complex $X$ can meet only finitely many cells of $X$. Suppose on the contrary that there is an infinite sequence of points $x_i\in C$ all lying in distinct cells. Then the set $S:=\{x_1,x_2,x_3,\dots\}$ is closed in $X$. Namely, assuming $S\cap X^{n-1}$ is closed in $X^{n-1}$ by induction on $n$, then for each cell $e_{\alpha}^n$ of $X$, $\varphi_{\alpha}^{-1}(S)$ is closed in $\partial D_{\alpha}^n$, and $\Phi_{\alpha}^{-1}(S)$ consists of at most one more point in $D_{\alpha}^n$, so $\Phi_{\alpha}^{-1}(S)$ is closed in $D_{\alpha}^n$. Therefore $S\cap X^n$ is closed in $X^n$ for each $n$, hence $S$ is closed in $X$...
I'm having trouble with the part where he starts the induction, I think that $\varphi^{-1}(S)$ is just short for $\varphi^{-1}_{\alpha}(S\cap X^{n-1})$ since the other intersection gives you the whole space $\partial D_{\alpha}^n$ and because $\varphi_{\alpha}$ is continuous it must be the case that the preimage of a closed set is closed.
I do not follow why $\Phi_{\alpha}^{-1}(S)$ must have at most one more point in $D_{\alpha}^n$; using this part as a fact how does the closedness of $\Phi_{\alpha}^{-1}(S)$ follows?
EDIT: As suggested ,$\varphi_{\alpha}:\partial D_\alpha^n\to X^{n-1}$ is the attaching map, $\Phi_\alpha:D_\alpha^n\to X$ is the characteristic map of the $n$-cell $e_\alpha^n$.
This is a bit late, but since no answer was chosen by the OP, I post this one.
We want to show that this is also true for any $n$-cell $e^n_\alpha$, the preimage of $S$ under its characteristic map $\Phi_\beta(S) $ is closed in the closed disk $D^n_\beta$.
There is, associated with this cell, an attaching map $\varphi_\alpha:S^{n-1}=\partial D^n_\alpha\to X^{n-1}$, which is continuous. By hypothesis $S\cap X^{n-1}$ is closed in $X^{n-1}$, then $\varphi^{-1}_\alpha(S)$ is closed in $\partial D^n_\alpha$ (As Adam remarked $\varphi_\alpha^{-1}(S)=\varphi^{-1}_\alpha(S\cap X^{n-1})$).
The boundary $\partial D^n_\alpha$ is closed in $D^n_\alpha$. Hence, so is $\varphi_\alpha^{-1}(S)$. Since there is at most one point of $S$ in $e^n_\alpha$ which is homeomorphic to $D^n_\alpha$.
Then $\Phi^{-1}_\alpha(S)=\varphi^{-1}_\alpha(S)\cup A$, where $A$ is either empty or a singleton. In any case, A is closed and so is $\Phi^{-1}(S)$ being the union of two closed sets. This implies that $S\cap X^n$ is closed in $X^n$. This is the characterization of the topology of $X$ given by Hatcher earlier in the appendix.