Application of the Brown's representability theorem 
I wonder how to use Brown's representability to get that $H^n(X,A)$ and $[X,K(A,n)]$ are bijective?
I know the functor $F$ should be $H^n(\cdot,A)$, then we know there exists some $C\in CW$ and some $c\in H^n(C,A)$, s.t. for all $X\in CW$, we have a bijection from  $[X,C]$ to $H^n(X,A)$ taking $f:X\to C$ to $F(f)(c)$. But how do we know $C$ is $K(A,n)$ and what's $c$?
 A: You are guaranteed a natural isomorphism between $\langle X, C \rangle$ and $H^n (X;A)$. Let $X=S^k$.  This tells you the homotopy groups of your representing space are exactly the homotopy groups of your sphere, so $C$ is an Eilenberg-MacLane space.
The Yoneda lemma tells us that our natural transformation from the homotopy classes of maps functor to cohomology is determined exactly by where the identity gets sent. This means that since pulling back an arbitrary element of the cohomology is natural, that the isomorphism can be written as pulling back a specific element in $K(A,n)$. 
I can describe an element $c$ for you, but there can be multiple such elements that give you similar natural isomorphisms (for example the inverse), and this even depends implicitly on how you identify the homotopy group with G. 
Since $K(A,n)$ is n-1 connected we have an isomorphism $H^n(K(A,n);A)=\operatorname{Hom}(H_n(K(A,n);A),A)=\operatorname{Hom}(\pi_n(K(A,n)),A)=\operatorname{Hom}(A,A)$. Let $c$ be the image of the identity of $\operatorname{Hom}(A,A)$ under this isomorphism. 
The way to describe this in words is that your cohomology class is the one whose action on homology is given by interpreting the class as a sphere and then interpreting that as an element of your group.
I'm not sure if you can actually use Brown representability to prove this element suffices.
Addendum: I believe it can be done by the following sketch. There is a functor $CW_* \rightarrow Ab$ given by assigning $X$ the image of$\langle X , K(A,n) \rangle$ under the natural transformation described above. There is an associated functor $Q$ given by quotienting out each $H^n(X;A)$ by the image of $X$ under this functor.
This functor should satisfy the wedge sum axiom because both homotopy classes of maps into $K(A,n)$ do and $H^n(-;A)$ does. Suppose it also satisfies the second axiom.
It can be checked without difficulty that $Q$ is trivial on the spheres. This means that its representing object $C$ has $\langle S^k, C \rangle = 0$. Since $C$ is a CW complex this implies $C$ is contractible, so the result follows.
