$G$ is a group with the property that the square of every element is the identity, then $G$ is abelian. Is my proof correct?
Attempt:
For every $a \in G, \space a^2 = e$ where $e$ is the identity element of $G$.
$a^2 = e \implies a = a^{-1}$**
$G$ is abelian if $\forall a,b \in G, \space ab=ba$
So we proceed:
if $ab = ba$
$ab\times a^{-1}b^{-1}=e$
By **
$\implies ab\times ab = e$ $\implies (ab)^2 = e$
By hypothesis this is true.
~ My question is; is this correct and also why does the $a$ from the right side get moved over first? Would I be able to write
if $ab = ba$
$ab\times a^{-1}b^{-1}=e$
as
if $ab = ba$
$ab\times b^{-1}a^{-1}=e$
with the $b$ first or does the order of moving elements over matter?