I remember hearing that (all) topological spaces are retracts of CW-complexes. Given a topological space $X$, I am trying to construct a CW-complex $Y$ with continuous morphisms $i:X\to Y$ and $r:Y\to X$, such that $r \circ i=\mathrm{id}_X$, but with no luck so far.
Could you please provide a reference, in case the statement is correct, or a counterexample otherwise.