# Let $X$ be a connected CW complex and $G$ a group such that every $\pi_1(X)\to G$ is trivial. Show that every $X\to K(G, 1)$ is nullhomotopic.

Question 2 in Chapter 1.B in Hatcher's Algebraic Topology:

Let $$X$$ be a connected CW complex and $$G$$ a group such that every homomorphism $$\pi_1(X)\to G$$ is trivial. Show that every map $$X\to K(G, 1)$$ is nullhomotopic.

Some defintions:

A $$K(G,1)$$ space is a path connected spaces whose fundamental group is isomorphic to a given group $$G$$ and which has a contractible universal covering space.

A map is nullhomotopic if is homotopic to the constant map.

A theory I have been thinking of using is Theorem 1B.9 in the text:

Let $$X$$ be a connected CW complex and let $$Y$$ be a $$K(G,1)$$. Then every homomorphism $$\pi_1(X, x_0)\to\pi_1(Y, y_0)$$ is induced by a map $$(X, x_0)\to(Y, y_0)$$ that is unique up to homotopy fixing $$x_0$$ .

Indeed, Theorem 1B.9 is a good tool here. In particular, you'll want to use the uniqueness part of the theorem. That means that any two maps $$(X,x_0)\to (K(G,1),y_0)$$ which induce the same map on $$\pi_1$$ are homotopic. What does that tell you about a map $$f:(X,x_0)\to (K(G,1),y_0)$$ which induces the trivial homomorphism on $$\pi_1$$?
It tells you $$f$$ is homotopic to the constant map $$(X,x_0)\to (K(G,1),y_0)$$, since the constant map also induces the trivial homomorphism on $$\pi_1$$. So, if there are no nontrivial homomorphisms $$\pi_1(X)\to G$$, this applies to every map $$f:X\to Y$$ (for an appropriate choice of basepoints $$x_0$$ and $$y_0$$).