Embedding a pointed topological space into a Eilenberg-MacLane space of its homology group We let $X$ be a CW complex with a unique 0-cell, given by the basepoint $x_0$, and no $k$-cells for $0 < k < n$.  I want to show that $X$ can be embedded into a $K(\pi_{n}(X,x_0),n)$ space. I am really not sure how to get started on this. I suspect that I should somehow make a use of the CW approximation theorem but in reality I don't really know what sort of construction I should be trying to build. Any help would be much appreciated.
 A: For any (connected?) CW complex, we may attach an $n$-cell, and the resulting subcomplex inclusion map $X\hookrightarrow X\coprod e_n$ is an isomorphism on all homotopy groups $\pi_k(X)$ for $k<n-1$, and a surjection for $k=n-1$, and has unknown or complex effect for $k>n-1.$
Basically $n$-cells are nullhomotopies of the generators of $\pi_{n-1}(X)$, and so attaching one can kill off a generator (depending on the attaching map), while leaving the lower homotopy groups unchanged. 
Starting with $k=n+2$, we want to attach an $(n+2)$-cell for every element of $\pi_{n+1}(X)$ (maybe it's enough to just iterate over the generators of $\pi_{n+1}(X)$?) to kill them. This leaves all the lower homotopy groups unchanged, but can scramble the higher ones of the resulting constructed CW complex.
$$
Y^{(n+2)} = X\coprod_{i\in\pi_{n+1}(X)} e^i_{n+2}.
$$
Then we ascend the skeleton, doing the same at each higher dimension, attach an $(n+3)$-cell to $Y^{(n+2)}$ for every element of $\pi_{n+2}(Y^{(n+2)})$ to kill all the elements of $\pi_{n+2}(Y^{(n+2)})$, and call the resulting complex 
$$
Y^{(n+3)} = Y^{(n+2)}\coprod_{i\in\pi_{n+2}(Y^{(n+2)})} e^i_{n+3}.
$$
Continue up all the dimensions of $X$, kill all the homotopy groups above $n$, and the resulting space $Y^{(\infty)} = \operatorname{colim} Y^{(k)}$ is a $K(G,n)$ and we have an inclusion $X \hookrightarrow K(G,n)$ as a subcomplex.
