This is the last question on a topology 1 exercise sheet, so hints aswell as solutions are highly appreciated!
We are given a based connected CW-complex $(X,x)$, and the map $$W:[X,S^1]_*\rightarrow Hom(\pi_1(X),\mathbb{Z}),$$
that is given by taking fundamental groups: $W([f]) = ([w]\mapsto[f\circ w])$.
Now this map is well-defined by functoriality and also it is a group homomorphism. What I want to show is that this is an isomorphism, but I'm stuck everytime I want to show surjectivity or injectiviy by hand. Extending maps from generators doesn't seem to cut it, and I'm running out of ideas. I was given a tip on the sheet: "Reduce to the case where X has only one 0-cell".
I found a related theorem in Hatcher (4.57 according to this question here). However, we have only defined homology groups and have only proven basic theorems about them, so I doubt this is the way to go (this is only week 6 of a topology 1 course).
Any help is appreciated, thanks!