$x^2\ast y = y = y \ast x^2$ implies commutativity? I would appreciate some help with this task:
Let be $S$ a non-empty set equipped with an operation $\ast :S\times S\to S$ such that $\ast$ is associative and has the property $x^2\ast y = y = y \ast x^2$ for every $x,y\in S$ (here, $x^2 = x\ast x)$. I have to show that $(S,\ast)$ is an abelian group. In other words, I have to show that there is an identity element $e$ such that $x\ast e = e\ast x = x$ for all $x$ and the commutativity $x\ast y = y \ast x$, for all $x,y \in S$
Note that, assuming there exists such element $e$, we have by virtue of the property  $x^2\ast y = y = y \ast x^2$ :
$$ x^2 = x^2\ast e = e  \quad \forall x\in S$$
This means that, in case an identity element exists, every element of $S$ is involutive. But how can I assert the existence of $e$ and, even more, the commutativity?.
Any hint is welcome. Thanks in advance.
 A: I'll drop the $\ast$'s.
First, if $x^2y=y=yx^2$ for all $x$ and $y$, then every $x^2$ works as an identity, and moreover $\{x^2:x\in S\}$ consists of single element, call it $e$. In particular, every element is its own inverse, $S$ is a group.
Finally, let $x,y\in S$. Then
$$
e=(xy)^2=xyxy\implies xy=y^{-1}x^{-1}=yx
$$
A: Identity element: We have to show $\exists\,e\in S\ \forall\,x\in S:\ ex=x=xe$.
Let $y\in S$ fixed, arbitrary. We have for all $x\in S$:
\begin{align*}
y^2x=x=xy^2\tag{1}
\end{align*}
We see from (1) that $y^2$ is an identity element $y^2=e$. We can also show it is unique: Let $z \in S$ fixed, arbitrary. We have
\begin{align*}
z^2e=\color{blue}{e=}&\color{blue}{ez^2}\\
&\color{blue}{ez^2=e^2z^2=z^2}=z^2e^2=z^2e
\end{align*}
and uniqueness $e=z^2$ of the identity element follows.
Inverse element: We have to show $\forall\, x\in S\ \exists\,y\in S:\ xy=e=yx$.
We have for $x\in S$:
\begin{align*}
x^2e=e=ex^2\qquad\Rightarrow\qquad x^2=e
\end{align*}
showing that $x$ is its own inverse for all $x\in S$.
Commutativity:
Let $x,y\in S$ fixed, arbitrary. We have since $z^2=e$ for all $z\in S$:
\begin{align*}
\color{blue}{xy}&=(xy)e=(xy)(yx)^2=(xy)(yx)(yx)\\
&=x(yy)x(yx)=xex(yx)=x^2(yx)=e(yx)\color{blue}{=yx}
\end{align*}
and the claim follows.
