I was re-reading an algebraic topology book the other day, and I came across the following problem:
Suppose that $\pi$ and $\rho$ are abelian groups and $n\geq 1$. Determine $[K(\pi,n),K(\rho,n)]$, the set of (based) homotopy classes of maps between the corresponding Eilenberg-MacLane spaces.
I believe that the following is a solution: We have two functors $K(-,n)$ from (discrete) abelian groups to (the homotopy category of nice) topological spaces, and $\pi_n = [S^n,-]$ going the other direction. When we suitably restrict these functors, they appear to be inverses. Therefore $[K(\pi,n),K(\rho,n)]\cong \hom_{Ab}(\pi,\rho)$
I have two questions. Is the solution correct, or are there errors in the logic? If it does work, is there a way to make it completely transparent that the functors are inverse to each other? And if it is correct, if we suitably topologize $\pi_n(-)$, does this extend to non-discrete topological groups?
Second, is there a different way to approach the problem which better illuminates what is going on or illustrates an important point about $K(\pi,n)$?