Prove that if for all $aba=bab$ then $|G|=1$.
Solution 1:
Your proof works, but it lacks mindless symbol pushing, so I offer two proofs by symbol pushing to restore balance to the world.
Proof I. Write $abab$ in two ways: $babb=aaba$. Then: $$aaba=b(ab)b=abbab$$ And cancel to get $aba=bbab$, but $aba=bab$, so $b=e$. $\square$
Proof II. We start with the natural equation $$baab=aabaa=ababa=babba$$ Now, cancel $ba$ on the left, so that $ab=bba$. But $$aba=bab\implies ab=baba^{-1}$$ Therefore, $bab=bbaa$ and so $ab=baa$ as well. This means $bba=baa$; cancelling on both left and right, $b=a$. Since $a,b$ are abitrary, we are done. $\square$