Let $\displaystyle R$ be a ring which is not necessarily commutative or with identity element. Suppose that there exists an integer $\displaystyle n \geq 0$ such that $\displaystyle 2x = 0$ and $\displaystyle x^{2^n +1} = x,$ for all $\displaystyle x \in R.$

Prove that $\displaystyle x^2=x,$ for all $\displaystyle x \in R,$ and hence $\displaystyle R$ is commutative.