Justify: $R$ is commutative 
Let $R$ be a ring. If $(ab)^n=a^nb^n$ holds for all $n$ and all $a, b\in R$, then justify that $R$ is commutative ring.

No idea how to prove it. But also fail to get one counter example. Please help
 A: By assumption
$$
(a(b+1))^2=a^2(b+1)^2=a^2b^2+2a^2b+a^2
$$
and by distrubutive law
$$
(a(b+1))^2=(ab+a)^2=(ab)^2+aba+a^2b+a^2
$$
From this it follows that
$$
a^2b=aba
$$
and this holds for all $a,b \in R$. Especially for $a+1$ and $b$
$$
(a+1)^2b=(a+1)b(a+1)=(ab+b)(a+1)=aba+ab+ba+b
$$
but compute the left side to get
$$
(a+1)^2b=(a^2+2a+1)b=a^2b+2ab+b=aba+ab+ab+b
$$
now compare
A: Let $R$ be the free ring on two generators $X$ and $Y$, modulo the relations $X^2 = Y^2 = XYX = YXY = 0$.  The additive group of $R$ is a free abelian group with generators $X,Y,XY,YX$.  Clearly $R$ is not commutative.
Note that the product of two elements of degree $\geq 2$ is identically zero.
Fix $n\geq 2$.  For any $a,b \in R$, $ab$ has degree $2$, so $(ab)^n = 0$.  But also $a^n$ and $b^n$ have degree $\geq 2$, so $a^n b^n = 0$, verifying the condition.

Note that Blah's proof appears to show that such an example is impossible when $R$ has an identity.  Also note that my example is a quotient of Amitai's example (and is, in some sense, the same proof).
A: The claim is false if $R$ is not assumed to be unital. Here is an example:
Let $K$ be a field, and $A:=K\langle x,y\rangle$ the free (non-commutative non-unital) algebra on two indeterminates. Let $I$ be the two sided ideal generated by $\{(ab)^n-a^nb^n|a,b\in A,n\in\mathbb{N}\}$, and set $R=A/I$. By construction, $R$ clearly satisfies the given condition. However, since $xy-yx\not\in I$ (as we will prove in the next paragraph), $R$ is not commutative.
We explain shortly why $xy-yx\not\in I$. Observe a general generator $(ab)^n-a^nb^n$ of $I$. If $n=1$, this generator vanishes, and this is also the case if $a,b$ commute. It follows that all non-vanishing generators are of degree $\geq4$, and the claim follows since $xy-yx$ has degree $2$. 
A: You do not really need the equality to be true for all $n$..
All you need to see is : 


*

*$(ab)^2=abab$

*$a^2b^2=aabb$ 
