I need to prove that having group $G$ where for each $a,b\in G$ the statement $(ab)^{n}=a^{n}b^{n}$ is true for three consecutive and natural $n$ numbers then the group $G$ is abelian.
The prove in the textbook I am using reads like this:
If $m, m+1$ and $m+2$ are these three consecutive and natural numbers we know that $(ab)^{m}=a^{m}b^{m}$ and $(ab)^{m+1}=a^{m+1}b^{m+1}$.
Then the proving continues like this: $a^{m+1}b^{m+1} = (ab)^{m+1} = (ab)^{m}ab = a^{m}b^{m}ab$ and simplifying we have $ab^{m}=b^{m}a$.
How was this simplification done? How did it get from $a^{m+1}b^{m+1} = (ab)^{m+1} = (ab)^{m}ab = a^{m}b^{m}ab$ to $ab^{m}=b^{m}a$?
I can see that it removes $ab$ from both sides of $(ab)^{m}ab = a^{m}b^{m}ab$ but I can't figure out why it finally comes up with $ab^{m}=b^{m}a$.