# Determine all groups $G$ for which there is a certain endomorphism

Determine all groups $$G$$ for which the map $$\phi:G\rightarrow G$$ defined by $$\phi(g) = g^2$$ is a homomorphism.

I have problems understanding the task, what is it: determine all such groups? Find a property that they all have? I checked the axioms of homomorphism, like nothing supernatural of them goes for the structure of the image.

$$\phi(g_1 g_2) = (g_1 g_2)^2 = g_1^2 g_2^2 = \phi(g_1)\phi(g_2)$$

$$\phi(1_G) = 1_G^2 = 1_G$$

$$\phi(g_1^{-1})=(g_1^{-1})^2 = g_1^{-2}$$

$$\phi(g_1 g_2)^{-1} = (g_1 g_2)^{-2} = g_2^{-2} g_1^{-2} = \phi(g_2^{-1})\phi(g_1^{-1})$$

$$\phi(g^0) = (g^0)^2 = g^0 = 1_G$$

$$\phi(g g^{-1}) = (g g^{-1})^2 = g^2 g^{-2} = 1_G$$

I have no idea about what I should check...

Hint: you've written $$(g_1g_2)^2 = g_1^2g_2^2$$. But $$(g_1g_2)^2 = g_1g_2g_1g_2$$ doesn't equal $$g_1^2g_2^2$$ in general. Think about what is required for this to be true...