<s>[INST] Given $x\cdot x =x$ Prove that it is a commutative ring I have seen some threads related to this, but I want to know whether my approach is correct.

Given $R$ a ring and that $\forall$ $x \in R, x\cdot x=x$. Then prove
  that it is a commutative ring.

My try:
Considering $$(x+y)\cdot(x+y)=x\cdot x+x\cdot y+y\cdot x+y\cdot y$$  we get
$$x+y=x+y+x\cdot y+y\cdot x$$
using Cancellation laws:
$$x\cdot y=-(y\cdot x)$$
$\implies$
$$x\cdot y=y\cdot (-x)$$
We have $$x\cdot x=x$$
$$(-x)\cdot (-x)=-x$$
But $$(-x)\cdot (-x)=x$$
So $$x=-x.$$
Hence $$x\cdot y=y\cdot x$$
Is this a valid proof?
 [/INST] Your proof looks fine! Just for fun, here is a another one using the same ideas.

Let $a,b \in R$. We have that  \begin{align} 
(a+b)(a+b) &= a\cdot a + a \cdot b + b \cdot a + b \cdot b\\
&= a + a \cdot b + b \cdot a + b\\
&\overset{*}{=} a + b
\end{align}
and using the Cancellation Law in $*$ gives us that $a\cdot b = -(b \cdot a)$, so $b \cdot a = -(a \cdot b)$. But then 
\begin{align}
(a\cdot b)\cdot (a\cdot b)&= a \cdot (b \cdot a) \cdot b\\
&= a \cdot (-(a \cdot b)) \cdot b\\
&=a \cdot ((-a)\cdot b)  \cdot b\\
&= (a \cdot (-a))\cdot (b \cdot b)\\
&=(-a)\cdot b\\
&= -(a \cdot b)\\
&= a\cdot b
\end{align} 
(where the last equality follows from $(a\cdot b)\cdot (a \cdot b) = a \cdot b$) and so $a\cdot b = - (a \cdot b)$ together with $b \cdot a = -(a \cdot b)$ give us that $a \cdot b = b \cdot a$. But $a$ and $b$ were chosen arbitrarily, so $R$ is indeed a commutative ring.
</s>