$\text{If}$ $ (a*b)^{2}=a^{2}*b^{2}$ $ \forall a,b \in G$ $\text{(*$ $ is an operator})$
$\text{LHS}\Rightarrow (a*b)*(a*b)$
$\qquad = a*b*a*b$
$\text{RHS}\Rightarrow a*a*b*b$
$\text{Comparing LHS and RHS}$
$\implies a*b*a*b=a*a*b*b$
$\text{Applying Cancellation law}$
$b*a=a*b \text{ (Commutative law)}$
$\text{So, it is Abelian group.}$ $\text{(It is a group and it follows Commutative property)}$