Fix $n > 1$ and let's say I have a $(n-1)$-connected space $X$ (not necessarily a CW-Complex) and an Eilenberg-Maclane space $K(\pi_n(X), n)$, I want to show (assuming that this is true in general of course) that there exists a continuous map $f : X \to K(\pi_n(X), n)$ such that the induced map $f_* : \pi_n(X) \to \pi_n(K(\pi_n(X), n)) \cong \pi_n(X)$ is (equivalent to) the identity map $1_{\pi_n(X)}$.
Now if the functors $\pi_n$ were full functors then this would be a trivial category theoretic proof. However I'm not sure if the functors $\pi_n$ are full functors and if they are not I guess I would have to construct such a map by hand.
I have two questions:
- Are the functors $\pi_n$ full functors?
- Are there any references where I can read up further about a proof of this?
One thing I will mention is that Lemma 4.31 in Hatcher's Algebraic Topology is quite similar to what I am looking for, however the problem with that is that the desired map works in the opposite way to what I'm looking for. (Though I guess that one could perhaps modify the proof of that to obtain the desired result I'm seeking).
Edit: I've added the assumption that $X$ is $(n-1)$-connected.
Here are two approaches.
If you believe that $K(A, n)$ represents the cohomology functor $H^n(-, A)$, then the set of homotopy classes of maps $[X, K(\pi_n(X), n)]$ can be identified with $H^n(X, \pi_n(X))$. By the universal coefficient theorem this is $\text{Hom}(H_n(X), \pi_n(X))$ (we use the assumption that $X$ is $(n-1)$-connected here), and by the Hurewicz theorem this is $\text{Hom}(\pi_n(X), \pi_n(X))$ (we use the $(n-1)$-connectedness assumption again here). Now we just take the element of this Hom corresponding to the identity.
Start with $X$ and repeatedly attach cells to kill off every element of $\pi_{n+1}(X)$, then $\pi_{n+2}(X)$, and so on. This eventually produces a $K(\pi_n(X), n)$ equipped with a map from $X$ inducing the identity on $\pi_n$.
This construction produces the first nontrivial stage in the Postnikov tower of $X$.