For a finite abelian $G$, $f: G\to G$ defined by $f(g)=g^2$ is an isomorphism iff $|G|$ is odd Let $G$ be an abelian group of finite order, and define $f: G\to G$ by $f(g)=g^2$. I would like to prove that $f$ is an isomporphism if and only if $G$ has an odd order.
I am able to prove that $f$ (defined above) is a homomorphism if and only if $G$ is abelian fairly simply. If $G$ is abelian, then for all $a, b\in G$,
$$f(ab)=(ab)^2=abab=a^2b^2=f(a)f(b)$$
So $f$ is indeed a homomorphism. And if $f$ is a homomorphism, then for all $a, b\in G$,
$$f(ab)=f(a)f(b) \implies (ab)^2=a^2b^2 \implies a^{-1}ababb^{-1}=a^{-1}aabbb^{-1}\implies ba=ab$$
Meaning $G$ is abelian.
This proof holds for any (not necessarily finite) group.
Applying this to the original problem, we are now left with proving that $f$ is bijective if and only if $G$'s order is odd. Since $f$ is from a finite $G$ to itself, it will suffice to show that:
$$|G| \space \text{is odd} \iff f \space \text{is injective (or surjective)}$$
But here I am stuck. I believe there is a simple way to finish off the proof, but I can't think of it, and I couldn't find this question asked here before. I appreciate any help.
 A: Suppose $|G|$ is odd. Let $g\in{ker(f)}$, meaning that $g^2=1$. Thus $g=1$ by Lagrange, otherwise $g$ is an element of order 2 in a group of odd order.
Now, suppose $|G|$ is even. Then, $G$ admits an element of order 2, let's say $h\in{G}$. Thus $ker(f)$ isn't trivial, because $h\in{ker(f)}$, meaning that $f$ is not an isomorphism.
A: Your analysis is good. In summary, if $G$ is a (multiplicative) group, then
the map $f\colon G\to G$, $f(x)=x^2$ is

*

*a homomorphism if and only if $G$ is abelian;


*surjective if and only if it is injective, when $G$ is finite.
Now, suppose the map is not injective. Then there exists an element $x\in\ker f$, $x\ne1$, meaning that $x^2=1$ and so $\langle x\rangle=\{1,x\}$ is a subgroup of order two. By Lagrange's theorem, the order of $G$ is even.
Conversely, if the order of $G$ is even, then there is a subgroup of $G$ having order two, by Cauchy's lemma, which implies that there exists $x\in G$, with $x\ne1$ such that $x^2=1$, and therefore $f$ is not injective.
Actually, Cauchy's lemma is not needed. Suppose $G$ (abelian or not) is a finite group of even order. Then you can consider the equivalence relation $\sim$ on $G$ defined by
$$
\text{$x\sim y$ if and only if either $y=x$ or $y=x^{-1}$}
$$
(the proof this is an equivalence relation is easy).
The equivalence classes have cardinality $1$ or $2$. If you remove the equivalence classes of cardinality $2$, you remain with an even number of classes of cardinality $1$; since the identity element lies in such an equivalence class, there must be another one, so another element $x\ne1$ that equals its reciprocal; but $x=x^{-1}$ is the same as $x^2=1$.
A: $f$ is injective if and only if $kerf=\{x\in G;g^{2}=0\}=0$. It is clear that $kerf=0$ if and only if $G$ has no element of even order (Because suppose that $g\in G$ such that $g^{m}=0$ where $m$ is even. Then, $m=2n$ for some $n$. Hence, $(g^{n})^{2}=0$. This shows that $g^{n}\in kerf$ which is a contraction).
