Bijection between basepoint-preserving homotopy classes and homomorphism between homological groups I have a question on Exercise 3.1.13 on Hatcher's textbook: 
Let $\langle X,Y\rangle$ denote the set of basepoint-preserving homotopy classes of basepoint preserving maps $X\rightarrow Y$. Show that if $X$ is a  connected CW complex and $G$ is an abelian group, then the map $\langle X,K(G,1)\rangle\rightarrow H^1(X;G)$ sending a map $f:X\rightarrow K(G,1)$ to the induced homomorphism $f_*:H^1(X)\rightarrow H_1(K(G,1))\approx G$ is a bijection, where we identify $H^1(X,G)$ with Hom$(H_1(X),G)$ via the universal coefficient theorem. 
I have managed to prove the "surjection" part by the hint on a proposition given by Hatcher, but I have the difficulty in the remaining "injection" part. Namely, how could I prove that any two mappings $f,g:X\rightarrow K(G,1)$, both of which induce the same homomorphism on $H_1$: $f_*=g_*:H_1(X)\rightarrow H_1(K(G,1))$, are the basepoint-preservingly homotopic? (Please avoid using general higher homotopy theorems because this exercise is for the first chapter of cohomology.) 
 A: I will not assume much homotopy theory, but I will assume that you know some basic facts about CW topology. Some of what I do gets a little explanation, but I apologise if it does not give you quite the elementary explanation you have asked for.
First note that it suffices to prove the case that $\dim X=2$. In general $X_{n+1}$ will be obtained from $X_n$ by attaching $n$-cells alongs a map $\bigvee S^n\rightarrow X_n$, and since $\pi_nK(G,1)=\pi_{n+1}K(G,1)=0$ for $n\geq2$, we see that any map $X_n\rightarrow K(G,1)$ extends uniquely up to homotopy to $X_{n+1}$.
Since $X$ is connected we can assume that it has a single $0$-cell. Since it is $2$-dimensional it is therefore a wedge of $1$-spheres with some number of $2$-cells attached and there is an exact sequence 
$$\dots \rightarrow H_1(\bigvee S^1)\xrightarrow{j_*} H_1X\rightarrow H_1(X,\bigvee S^1)\rightarrow\dots$$
where $j$ is the inclusion of the $1$-skeleton $X_1\simeq\bigvee S^1$.
However, using the CW structure of $X$ we know that there is a homeomorphism $X/X_1=X_2/X_1\cong\bigvee S^2$, with one summand appearing in the wedge for each $2$-cell of $X$. Thus
$$H_1(X,\bigvee S^1)\cong\widetilde H_1(X/\bigvee S^1)\cong\widetilde H_1(\bigvee S^2)=0$$
and the map $j_*$ in the first sequence is onto.
Now, applying $Hom(-,G)$ to the first sequence we get an injection 
$$0\rightarrow Hom(H_1X,G)\rightarrow Hom(H_1(\bigvee S^1),G)\rightarrow\dots $$
and we use this to conclude that if $f_*=g_*$, then $f|_{X_1*}=g|_{X_1*}$. But it is easy to see that the special case $\langle S^1,K(G,1)\rangle\cong Hom(H_1(S^1),G)\cong G$ holds, and since
$$\langle \bigvee S^1,K(G,1)\rangle\cong \bigoplus\langle S^1,K(G,1)\rangle\cong \bigoplus G$$
we may conclude that $\langle X_1,K(G,1)\rangle\cong Hom(H_1X_1,G)$. Thus $f|_{X_1*}=g|_{X_1*}$ implies that there is a homotopy 
$$F:f|_{X_1}\simeq g|_{X_1}.$$
Now give $I$ its standard CW structure and consider $X\times I$. Since $I$ is a finite complex, $X\times I$ is a CW complex and $\dim(X\times I)=3$. The triple of the homotopy $F$ and the maps $f,g$ now defines a map out of the $2$-skelton
$$\widetilde F:(X\times I)_2=(X_1\times I)\cup (X_2\times\partial I)\rightarrow K(G,1)$$
But $X\times I$ is formed from $(X\times I)_2$ by attaching $3$-cells along some map
$$\varphi:\bigvee S^2\rightarrow (X_1\times I)\cup (X_2\times\partial I),$$
and since $\pi_2K(G,1)=0$ the composite $\widetilde F\varphi$ is null-homotopic. Choosing a null-homotopy defines an extension of $\widetilde F$ to the $3$-skeleton $(X\times I)_3=X\times I$. Such an extension is exactly a homotopy 
$$f\simeq g.$$
