Finite ring has only zero divisors and units [duplicate]
Solution 1:
If $\mathbb D$ is finite, with $n$ elements, and $a\in \mathbb D$ does not have a multiplicative inverse, we consider the elements $$ad_1, ad_2 \dots ad_n$$where the $d_i$ are the $n$ distinct elements of $\mathbb D$. None of these elements is $1$, so the $n$ elements can have at most $n-1$ different values - so two of them must be equal.$$ad_i=ad_j \implies a(d_i-d_j)=0$$Since $d_i\neq d_j$, $a$ is a zero-divisor.
Note that this does use the finiteness assumption in an essential way. $2\in \mathbb Z$ does not have a multiplicative inverse, and is not a zero divisor. There are a number of proofs like this (eg a finite integral domain is a field, not true in the infinite case) which depend on being able to count the elements of a finite object.
Note that in the ring of integers mod $14$, $7$ does not have a multiplicative inverse, and $2\times 7=0$. In the ring of integers mod $15$ we have $7\times 13 =1$ and $7$ is not a zero divisor.
Solution 2:
Hint: Consider the map sending $r \to ra$. Use the fact that $a$ does not have a multiplicative inverse, so it's not onto; hence, in the finite case, it's not injective. Find a non-trivial kernel element and see what happens.
Note that the word finite is important here. The proof I've mentioned breaks down since the map $r \to 7r$ is injective, even though it's not surjective. More generally, in infinite rings, elements can be non-units and non-zero-divisors.
Solution 3:
Consider the applications $l_a:\mathbb{D}\rightarrow\mathbb{D}$ and $r_a:\mathbb{D}\rightarrow\mathbb{D}$ given by $l_a(x)=a\cdot x$ and $r_a(x)=x\cdot a$. Both are injective if $a$ is not a zero divisor. But, because $\mathbb{D}$ is finite both are surjective too. Then you have left and right inverses for $a$ and you are done.