I found elementary algebra exercise which I can't resolve. Let algebraic structure $(X,\cdot)$ where $\cdot$ has properties:
$$ x\cdot(x\cdot y)=y \\ (y\cdot x)\cdot x=y $$
How to proof that $\cdot$ is commutative? If $X=\mathbb{Z}$ and $m\cdot n=-m-n$ then it is true and $\cdot$ has expected poroperties.
$$ m\cdot(m\cdot n)=-m-(-m-n)=n\\ (n\cdot m)\cdot m=-(-n-m)-m=n $$
and
$$ m\cdot n=-m-n=-n-m=n\cdot m $$
Note first that that the right cancellation law holds:
If $y \cdot x = y' \cdot x$, then $y = (y \cdot x) \cdot x = (y' \cdot x) \cdot x = y'$.
Now given any elements $a$ and $b$, write
$$(a \cdot (b \cdot a))\cdot (b \cdot a) = a = b \cdot (b \cdot a)$$
Right-cancellation yields
$$a \cdot (b \cdot a) = b.$$
Now we have
$$ b \cdot a = a \cdot (a \cdot (b \cdot a)) = a \cdot b.$$