If $|a^{2}|=|b^{2}|$ then $|a|=|b|?$ If $|a^{2}|=|b^{2}|$ (for non identity elements $a$ and $b$ of a group $G$ and $|a|$ denotes the order of the element $a$) prove or disprove that $|a|=|b|.$
I tried as follows
Clearly infinite order case is trivial. Let is discuss finite order case
$$|a^{2}|=|b^{2}|$$
$\Rightarrow$$$\frac{|a|}{(2,|a|)}=\frac{|b|}{(2,|b|)}  $$ where $(2,|a|)$  is the $\gcd$. Now I am stuck. How proceed further. Thanks in advance. 

(EDIT along Erick Wong's comment - I overlooked the (somewhat irrelevant) condition that the elements should not be the identity).
Consider the cyclic group of order $6$. Let $a$ be a generator and $b=a^2$. Then $a^2=b$ and $b^2$ have order $3$, but $a$ has order $6$.
