Let S be a set and . be binary operation on S satisfying the two laws x . x = x for all x in S, (x.y) . z = (y . z).x - for all x, y z in S. Show that x.y = y.x for all x, y in S. ''solution'': x.y=(x.y)(x.y)=[y.(x.y)].x=[(x.y).x].y=[(y.x).x].y=[(x.x).y].y=[(y.y)].(x.x)=y.x
I was wondering if I am right in my resolution of this problem (which incidentally need not solve by commutative algebra).
I didn't find anything wrong with what you've done. Note when I tried solving this myself, I mirrored what you did except for your last $2$ steps. You have
$$[(x\cdot x)\cdot y]\cdot y=[(y\cdot y)]\cdot (x\cdot x)=y\cdot x \tag{1}\label{eq1A}$$
I instead got
$$[(x\cdot x)\cdot y]\cdot y = [x \cdot y] \cdot y = (y \cdot y) \cdot x = y \cdot x \tag{2}\label{eq2A}$$
This involves one more step than your solution, so in that respect yours is better, but it does at least show there's more than one way to prove the result, i.e., the commutative property holds with this set & $2$ defined binary operations.
A potentially interesting question is if there is any shorter method (i.e., requiring fewer steps) than what you've done and, if so, how much shorter can it be. I don't know the answer, or any easy way to determine it.