TITLE: Number of elements in a ring with identity s.t. $x^2 = 1_R$ for all $0_R \neq x\in R$?
QUESTION [7 upvotes]: I'm not sure how to go about finding the solution to this question.

Let R be a ring with identity such that $x^2 = 1_R$ for all $0_R \neq x\in R$. How many elements are in $R$?

I've just been playing around with squaring elements, like $$(x+1_R)^2 = x^2+2.x+1_R =2.x+2.1_R = 1_R.$$
But I'm not sure where to go with this. Any help?

REPLY [2 votes]: $\rm R=0\:$ works. Else $\rm\ x\ne 0$ $\Rightarrow$ $\rm x^2 =1$ $\Rightarrow$ $\rm x^{-1} = x $ $\Rightarrow$ $\rm R$ field, so $\rm\: x\ne 0\!\iff\!\! (x-1)(x+1) = 0$ $\iff$ $\rm x=\pm 1.\:$ But $\rm\: R\backslash0 = \{\pm1\}$ $\!\iff\!$ $\rm R\:\! \cong\:\! \mathbb Z/2\:$ or $\:\mathbb Z/3$.  
More generally, the finite fields $\:\rm\mathbb F_p,\: \mathbb F_q,\ p,q\:$ prime, are axiomatized by the ring axioms plus
$$\rm x^n =\: x,\quad n\: =\: 1 + lcm(p\!-\!1,q\!-\!1)$$
$$\rm q\:(x^p-x)\: =\: 0\: =\: p\:(x^q-x)$$
$$\rm pq\: =\: 0$$
Thus any identity true in both of these fields has a purely equational proof from the above axioms. This theorem extends similarly to any finite set of finite fields, for example see  Stanley Burris and John Lawrence, Term rewrite rules for finite fields (1991). This result is very closely related to Jacobson's model-theoretic proof of commutativity of rings satisfying the identity $\rm\: x^{n_x} =\: x$.