Let $S$ be a Semigroup with the two following properties, $(1):$ for all $x$ in $S$ we have $x^3=x$ $(2):$ for any $x,y$ in $S$ we have $xy^2x=yx^2y$. Then prove that this Semigroup $S$ is commutative.
I have found the following identities for any $x,y$ in $S$
$(xy)^3=xy=x^3y^3$
$xy^2x=y^2(xy^2x)$
$(xy)^2=y(xy)^2y$
$xy^2x^2x=yx^2yx^2$
$$yxy=yxyyxyyxy=yxy^2xy^2xy=yyx^2yy^2xy=y^2x^2yxy=$$ $$=yxy^2xxy=yxy^2x^2y=yxyxy^2x,$$ which gives $$yxy^2=yxyxy^2xy.$$ In another hand, $$xyxy=xyy^2xy=y(xy)^2y=yxyxy^2,$$ which gives $$xy=(xy)^3=yxyxy^2xy.$$ Thus, $$xy=yxy^2$$ and also, $$yx=xyx^2$$ or $$xy^2=yxy$$ and $$yx^2=xyx.$$ Now, $$x^2yx^2y=x^2yy^2x^2y=y(x^2y)^2y=yx^2yx^2yy=yx^2yx^2y^2.$$ Thus, $$x^2y=(x^2y)^3=yx^2yx^2y^2x^2y=xy^2xx^2y^2x^2y=$$ $$=xy^2xy^2x^2y=yx^2y^3x^2y=yx^2yx^2y,$$ Which gives $$xy=x(x^2y)=(xyx^2)(yx^2y)=(yx)(xy^2x)=yx^2y^2x=x^2yx.$$ Id est, $$x^2y=xyx=yx^2$$ and $$xy=x(x^2y)=xyx^2=yx.$$