Problem statement: if $G$ is a group and $a,b\in G$, prove that if $|ab|=k$, then $|ba|=k$.
I'm going to assume one thing: that $|a|$ means $|\langle a \rangle|$, that is, the size of the subgroup generated by $a$.
I argued that the size of each subgroup is less than or equal to the size of the other subgroup, and that therefore, their sizes are equal.
($|ba|\leq |ab|$) Every element $g\in \langle ba \rangle$ has the form $(ba)^n$, where $n\in \mathbb{Z}$. This element can be generated by $n+1$ compositions of $ab$: $(ab)^{n+1}= a(ba)^nb$. This means that every element in $\langle ba\rangle$ can be generated in $\langle ab\rangle$ and that therefore $\langle ab\rangle$ must have at least as many elements as $\langle ba\rangle$.
I used the same reasoning to conclude $|ab|\leq |ba|$.
What is wrong with this reasoning (if at all)?