CW-complex, Hausdorff space, second-countable space, sober space
connected space, locally connected space, contractible space, locally contractible space
For every topological space $X$ there is a CW complex $Z$ and a weak homotopy equivalence $f \colon Z\to X$. Such a map $f \colon Z\to X$ is called a CW approximation to $X$.
Such CW-approximation may be constructed case-by-case by iteratively attaching (starting from the empty space) cells for each representative of a homotopy group of $X$ and further cells to kill off spurious homotopy groups introduced this way (e.g. Hatcher, p. 352-353).
In the classical model structure on topological spaces $Top_{Quillen}$, the cofibrant objects are the retracts of cell complexes, and hence CW approximations are in particular cofibrant replacements in this model structure.
The Quillen equivalence $Top_{Quillen} \stackrel{\overset{{\vert - \vert}}{\longleftarrow}}{\underset{Sing}{\longrightarrow}} sSet_{Quillen}$ to the classical model structure on simplicial sets (“homotopy hypothesis”) yields a functorial CW approximation (by this proposition) via
(geometric realization of the singular simplicial complex of $X$) with the adjunction counit
a weak homotopy equivalence.
Let $f \;\colon\; A \longrightarrow X$ be a continuous function between topological spaces. Then there exists for each $n \in \mathbb{N}$ a relative CW-complex $\hat f \colon A \hookrightarrow \hat Y$ together with an extension $\phi \colon Y \to X$, i.e.
such that $\phi$ is n-connected.
Moreover:
if $f$ itself is k-connected, then the relative CW-complex $\hat f$ may be chosen to have cells only of dimension $k + 1 \leq dim \leq n$.
if $A$ is already a CW-complex, then $\hat f \colon A \to X$ may be chosen to be a subcomplex inclusion.
For every continuous function $f \colon A \longrightarrow X$ out of a CW-complex $A$, there exists a relative CW-complex $\hat f \colon A \longrightarrow \hat X$ that factors $f$ followed by a weak homotopy equivalence
Apply prop. 1 iteratively for all $n$ to produce a sequence with cocone of the form
where each $f_i$ is a relative CW-complex and where $\phi_n$ in n-connected.
Let then $\hat X$ be the colimit over the sequence (its transfinite composition) and $\hat f \colon A \to X$ the induced component map. By definition of relative CW-complexes, this $\hat f$ is itself a relative CW-complex.
By the universal property of the colimit this factors $f$ as
Finally to see that $\phi$ is a weak homotopy equivalence: since n-spheres are compact topological spaces, then every map $\alpha \colon S^n \to \hat X$ factors through a finite stage $i \in \mathbb{N}$ as $S^n \to X_i \to \hat X$ (by this lemma). By possibly including further into higher stages, we may choose $i \gt n$. But then the above says that further mapping along $\hat X \to X$ is the same as mapping along $\phi_n$, which is $n$-connected and hence an isomorphism on the homotopy class of $\alpha$.
For $X$ any sequential spectrum in Top, then there exists a CW-spectrum $\hat X$ and a homomorphism $\phi \colon \hat X \to X$ which is degreewise a weak homotopy equivalence, hence in particular a stable weak homotopy equivalence.
First let $\hat X_0 \longrightarrow X_0$ be a CW-approximation of the component space in degree 0, via prop. 2. Then proceed by induction: suppose that for $n \in \mathbb{N}$ a CW-approximation $\phi_{k \leq n} \colon \hat X_{k \leq n} \to X_{k \leq n}$ has been found such that all the structure maps are respected. Consider then the continuous function
Applying prop. 2 to this function factors it as
Hence we have obtained the next stage of the CW-approximation. The respect for the structure maps is just this factorization property:
Tammo tom Dieck, section 8.6 of Algebraic topology, EMS (2008)
Allen Hatcher, Algebraic topology, Cambridge Univ. Press 2002; Chapter 4, Section 4.1 pdf