I have to prove that if $(ab)^i = a^ib^i$ is valid for $3$ consecutive integers, then the group is abelian.
I've found this answer in the internet, but I can't understand the part that says we can cancel $a$ from the left and $b$ from the rigth.
For example:
$(\color{red}{a^{-1}}a)b(ab)^i = (\color{red}{a^{-1}}a)b a^{i+1}b^{i+1} \implies b(ab)^i = a^{i}b^{i+1}$
But how can I cancel $b$? Also, could someone explain this proof for me?