Proposition 3.5.3.8. Let $f: X \rightarrow Y$ be a weak homotopy equivalence of topological spaces. Assume that both $X$ and $Y$ have the homotopy type of a CW complex (that is, there exist homotopy equivalences $X' \rightarrow X$ and $Y' \rightarrow Y$, where $X'$ and $Y'$ are CW complexes). Then $f$ is a homotopy equivalence.

**Proof of Proposition 3.5.3.8.**
In what follows, we denote the homotopy class of a continuous function $f: X \rightarrow Y$ by $[f]$. Let $f: X \rightarrow Y$ be a weak homotopy equivalence of topological spaces, and suppose that there exists a homotopy equivalence $u: Y' \rightarrow Y$, where $Y'$ is a CW complex. Using Lemma 3.5.3.11, we deduce that $[u] = [f] \circ [ \overline{u} ]$ for some continuous function $\overline{u}: Y' \rightarrow X$. Let $v: Y \rightarrow Y'$ be a homotopy inverse to $u$ and set $g = \overline{u} \circ v$. Then

so $g$ is a right homotopy inverse to $f$. Since $f$ is a weak homotopy equivalence, it follows that $g$ is also a weak homotopy equivalence. If $X$ also has the homotopy type of a CW complex, then we can apply the same reasoning to deduce that $g$ admits a right homotopy inverse $f': X \rightarrow Y$. Then

It follows that $g$ is also a left homotopy inverse to $f$, so that $f$ is a homotopy equivalence (with homotopy inverse $g$). $\square$