If in a semigroup S,$ \ $ $ x^{k+1} = x $ for some $k \ge 1$ and $xy^kx = yx^ky \quad \forall x,y \in S$ then show that S is abelian.
I'm able to prove the following $\ x=x^3, \quad x^2y^2=y^2x^2=(xy^2)^2=(y^2x)^2 \ and \ x^k=x^2 \quad \forall x,y \in S$
I thought of proving $x^2=y^2 \quad \forall x,y \in S$ and so S will have an identity element, but couldn't do it and don't know whether the approach is correct.
I will use some of the properties that you are able to prove.
$x^2=x^k$ So $x^4=(x^2)^2=(x^2)^k=x^{k+1}x^{k-1}=xx^{k-1}=x^k$ and $x^6=x^{k+1}x^{k-1}x^k=x^kx^k=x^2x^2=x^4=x^k$
(1) Finally we can prove that $\forall n,x^{2n}=x^k$ (by induction)
Also $x^3=x$ So $x^5=x^3x^2=xx^k=x^{k+1}=x$
(2) So we have $\forall n,x^{2n+1}=x$ (by induction)
Case 1 : k is odd
With (1) and (2) we have $x=x^k$ and $\forall n, x^n=x $
$xyx=yxy\Rightarrow x^2yx=(xy)^2 \Rightarrow xyx=xy$
$xyx=yxy \Rightarrow (yx)^2=y^2xy \Rightarrow yx=yxy=xyx$
Finally $xy=yx$
Case 2 : k is even
I can't find a solution in this case, sorry.