Number of elements in a ring with identity s.t. $x^2 = 1_R$ for all $0_R \neq x\in R$? 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?
 A: $\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$.
A: One possibility, of course, is $R=\{0\}$. Assume $1_R\neq 0$. 
$R$ has no zero divisors: if $xy=0$ and $x\neq 0$, then $y = 1_Ry = xxy = x(0)=0$.
$R$ is commutative: if $x$ and $y$ are nonzero, then so is $xy$ by the above; hence $(xy)^2 = x^2y^2$; canceling from $xyxy=xxyy$ we get $yx=xy$. 
(Of course, the ring satisfies $x^3=x$ for all $x$, so by a famous theorem of Jacobson, the ring is necessarily commutative; but we don't need to call in that heavy cannon to the fray).
Since every nonzero element is invertible, $R$ is a field. Since $x^2-1_R$ has $|R-\{0\}|$ solutions, we have $|R-\{0\}|\leq 2$, so $|R|\leq 3$.
If $1_R+1_R=0$, then $R$ is of characteristic $2$, so $R\cong \mathbb{F}_2$ and $|R|=2$. And, indeed, in this case the hypothesis holds.
If $1_R+1_R\neq 0$, then we get $4\cdot 1_R = 1_R$, hence $3\cdot 1_R=0$, so $R$ is of characteristic $3$, and therefore $R\cong\mathbb{F}_3$ and $|R|=3$. Again, the hypothesis holds for this ring.
In summary, $R$ has either $1$, $2$, or $3$ elements, and is either the trivial ring, $\mathbb{F}_2$, or $\mathbb{F}_3$. 
