Induced map on Eilenberg-MacLane space Let $X$ be an $n-1$ connected space. Why does a map $X\rightarrow K(\pi_n(X),n)$ that induces an isomorphism on $\pi_n$ exist and what is this map?

If $X$ is a CW-complex, then you can build a $K(\pi_n(X),n)$ by attaching cells (of dimension $n+2$ and above) to $X$ to kill off the higher homotopy groups. The map you are thinking of is then an inclusion of $X$ into $K(\pi_n(X),n)$ as a sub-complex.
