The standard approach to proving that $H^n(X; G)$ is represented by $K(G, n)$ seems to be to prove that $\text{Hom}(X, K(G, n))$ defines a cohomology theory and then use Eilenberg-Steenrod uniqueness. This is utterly spiffing, but as far as I can see gives little geometric intuition. In his treatment, Hatcher mentions that there is a more direct cell-by-cell proof, albeit a somewhat messy and tedious one. I haven't been able to find any such proof, but I'd really like to see one; I think it would help me solidify my mental picture of Eilenberg-MacLane spaces. Does anyone have a reference?



"Dirty" proof that Eilenberg-MacLane spaces represent cohomology?
I'd suggest looking up some basic material on obstruction theory. There, you generally find classification of maps $X \to Y$ with domain a CW-complex in terms of cohomology groups $H^s(X;\pi\_t(Y))$. The proofs are often very cellular indeed.


In the case where the range is an Eilenberg-Maclane space (for an abelian group), the dirty proof is something like:


* Any map from $X$ is homotopic to one where the (n-1)-skeleton $X^{(n-1)}$ maps to the basepoint of $Y$.
* A map on the n-skeleton $X^{(n)}$ sending the (n-1)-skeleton to the basepoint is determined, up to homotopy, by a choice of element of $G$ for each n-cell of $X$, essentially by definition of homotopy. This is an element in the n'th CW-chain group $C^n\_{CW}(X;G)$.
* Such a map extends to all higher skeleta if and only if the attaching maps for all the (n+1)-cells become nullhomotopic in $Y$. Thus the map extends if and only if it's represented by a cocycle, i.e. an element of $Z^n\_{CW}(X;G)$.
* This is a complete invariant, up to homotopy, of maps that are trivial on the (n-1)-skeleton. (Higher cells have basically unique maps up to homotopy.)
* Any homotopy between two such maps can be pushed to a homotopy that's trivial on the (n-2)-skeleton of $X$.
* Such a homotopy is determined, up to a "track" (a homotopy between homotopies), by a choice of element of $G$ for each (n-1)-cell of $X$.
* Such a homotopy alters the map on the n-skeleton (as an element of $C^n\_{CW}(X;G)$) by adding a coboundary element, something in $B^n\_{CW}(X;G)$.
* Therefore, the full mapping space mod homotopy is $H^n\_{CW}(X;G)$.


This is a little messy. Often it's nice to use the filtration of $X$ by subcomplexes $X^{(n)}$ and use that each inclusion in the filtration induces a fibration of mapping spaces
$$F(X^{(n)}/X^{(n-1)},Y) \to F(X^{(n)},Y) \to F(X^{(n-1)},Y)$$
to clean this homotopical analysis up a little into something slightly more systematic. This leads to a spectral sequence for the homotopy groups of the mapping spaces in terms of the cohomology of $X$ with coefficients in the homotopy groups of $Y$, but you have to be a little careful because there is a "fringe" that exhibits some non-abelian-group-like behavior.


