let a,b in R then we show that ab=ba , take (a+b)^2=a+b by assume , then a^2+ab+ba+b^2=a+b, since a^2=a and b^2=b so we have a+ab+ba+b=a+b then ab+ba=0, since z^2=z and -z=(-z)^2=-z*-z=z^2=z for any element in R so ab=-ba=ba therefore ab=ba
not forget form the like option