I was wondering if there was a ring so that any two distinct non-zero elements do not commute.
Formally, is there a ring $R\not=\{0\}$ so that
$$\forall x,y\in R\setminus\{0\}, x\not= y\implies xy\not=yx$$
Obviously, $\{0\}$ and $\Bbb Z/2\Bbb Z$ work but I'm searching for a non-trivial example (or a proof that there is none).
If $R$ has a $1$, then if we have $x\in R$ so that $x\not=0$ and $x\not=1$ (that is, $R\not=\Bbb Z/2\Bbb Z$), $x$ and $1$ commute.
$$\boxed{R\text{ doesn't have }1}$$
Let $x\in R$
$(x+x)x=xx+xx=x(x+x)$
We have $x=0$ or $x+x=0$ or $x+x=x$
So $x+x=0$
$$\boxed{R\text{ has characteristic }2}$$
Suppose we have a nilpotent element $x\in R$
$\exists n\in\Bbb N^*,x^{n}=0$
If $n=1$, $x=0$
If $n=2$, $x^2=0$
If $n>2$, $x^{n-1}\not=x$ but they commute
$$\boxed{\text{The square of a nilpotent element is }0}$$
(Given by Arthur in the comments)
Let $x\in R$
$x$ and $x^2$ commute so $x=0$ or $x^2=0$ or $x=x^2$
$$\boxed{\text{Every element is either nilpotent or idempotent.}}$$
Kevin Carlson's suggestion in the comments does the job. Namely, take the $\mathbb Z/2\mathbb Z$-vector space $$R=\mathbb Z/2\mathbb Z v\oplus\mathbb Z/2\mathbb Z w$$ and define multiplication by setting $v^2=v=vw$, $w^2=w=wv$ and extending linearly to the sum. In particular, $(av+bw)(cv+dw)=a(c+d)v+b(c+d)w=(c+d)(av+bw)$ for $a,b,c,d\in\mathbb Z/ 2\mathbb Z$. This multiplication is easily checked to be associative by verifying that $$(av+bw)(cv+dw)(ev+fw)=(c+d)(e+f)(av+bw)$$ in either order of multiplication. (In fact, this is associative over any ring of coefficients.)
Though Kevin already demonstrated that $R$ satisfies: $$\forall x,y\in R\setminus\{0\}, x\not= y\implies xy\not=yx$$ but for completeness I will include that argument here. Suppose $x=av+bw\neq 0$, $y=cv+dw\neq 0$, and $xy=yx$. Then $$a(c+d)v+b(c+d)w=c(a+b)v+d(a+b)w$$ so in particular, $a(c+d)=c(a+b)$ and $d(a+b)=b(c+d)$ and thus $ad=cb$. Now if $a=0$, then since $x\neq 0$ we must have $b=1$, hence $c=0$ and $d=1$, so $x=y$. An identical argument applies to the case $b=0$, so we can assume $a=b=1$. But then $c=d=1$ so again $x=y$. Therefore, non-equal non-zero elements do not commute. (I should also note that here, we need that the coefficients are all in $\mathbb Z/2\mathbb Z$. Since $v,w$ are idempotent, it is easy to see that an arbitrary coefficient ring of character $2$ would not work from the properties listed in the OP.)