Torsion in the integral (co)homology of Eilenberg-MacLane spaces
Solution 1:
A bit more elementary than using localizations of spaces, you can prove this by induction on $n$ using the Serre spectral sequence. Specifically, consider the Serre spectral sequence for homology with coefficients in $\mathbb{Z}[1/p]$ for the fiber sequence $K(G,n)\to *\to K(G,n+1)$. This tells you that if $n\geq 1$ and $K(G,n)$ has trivial reduced homology with coefficients in $\mathbb{Z}[1/p]$ then so does $K(G,n+1)$. Starting from the base case $n=1$, it then follows that $\tilde{H}_*(K(G,n),\mathbb{Z}[1/p])\cong \tilde{H}_*(K(G,n),\mathbb{Z})\otimes\mathbb{Z}[1/p]$ is trivial for all $n\geq 1$.
Solution 2:
If $n>1$, the theory of localizations easily applies. For a simply connected space $X$, the localization $X[1/p]$ has the effect on both homotopy and homology with tensoring by $\mathbb{Z}[1/p]$. Thus, when we invert $p$ in $K(G,n)$ for a p-group $G$, we end up with something with trivial homotopy groups. Since a CW complex with trivial homotopy groups also has trivial homology groups, we conclude that $H_*(K(G,n)) \otimes \mathbb{Z}[1/p]$ is trivial which implies that $H_*(K(G,n))$ are always p-groups. Then the universal coefficient theorem gives you it for cohomology.