Suppose $G$ is a finite Abelian group and G has no elements of order 2. Show that the map $\phi: G \to G$ given by $g \to g^2$ is an isomorphism. Is the map an isomorphism if we do not assume $G$ is finite?
Attempt:
Take $x,y \in G$. Then $\phi(xy) = (xy)^2=xyxy=x^2y^2=\phi(x)\phi(y)$. Hence $\phi$ is homomorphic.
Assume $\phi(x) = \phi(y) \implies x^2 = y^2 \implies x^2y^{-2} = e \implies (xy^{-1})^2=e$. Since there is no element of order 2, then $xy^{-1}$ must be identity. This means $x = y$. Hence injective.
I am having trouble proving that the map is surjective.
Also, what happens if we do not assume $G$ is finite? (I'd assume it won't be an isomorphism anymore, but why?)