Example of a ring where all but two of its elements are units One way of viewing a field is just as a ring where all but one of its elements (namely $0$) is a unit. I'm looking for rings (commutative with a 1) where all but two of its elements are units. I found one fairly trivial example, $\mathbb Z/4 \mathbb Z,$ and I think I may have a proof that it's the only example of such a ring that's finite:
If $R$ is some finite ring, then considering $R$ as an additive group and applying the structure theorem for finite abelian groups, we get that $R$ is isomorphic to a direct product of groups of the form $\mathbb Z/n_i \mathbb Z,$ and the $n_i$ are coprime. I believe that this means that $R$ is also isomorphic to this as a ring (is this correct?). For each $n_i$ the size of $\left(\mathbb Z/n_i \mathbb Z\right)^*$ is $\phi(n_i).$ Let $n=|R|$. Since $\phi$ is multiplicative over coprime elements, we have $n=\Pi_i n_i$ and $|R^*|=n-2=\Pi_i \phi(n_i)$. But $\phi(n_i)\leq n_i-1,$ so obviously there can only be one factor $\mathbb Z/n_1 \mathbb Z$. Then $n_1=n$ and all we need is that $\phi(n)=n-2$. Writing $n$ as a product of primes $n=2^{r_2}3^{r_3}5^{r_5}\cdots$ we get 
$$\phi(n)= n-2=\phi(2^{r_2})\phi(3^{r_3}) \phi(5^{r_5})\cdots\\
=(2^{r_2}-2^{r_2-1})(3^{r_3}-3^{r_3-1})(5^{r_5}-5^{r_5-1})\cdots
$$
Again, it's clear that there can only be one factor as otherwise the expression for $\phi(n)$ in the final line would be too small. Say $n=p^{r_p}$ and $p^{r_p}-2=p^{r_p}-p^{r_p-1}$ Then $p^{r_p-1}=2$. Hence $p=2$ and $r_p=2$ i.e. $n=4.$
Can anyone tell me whether this proof is correct or not. 
My main question: are there any more examples with infinite rings? I feel like the answer is no because it seems very hard to have so many units, but I have no idea how to start to prove this in general. I tried local rings: If $R$ was a local ring, with unique maximal ideal $I$, then $R=I\sqcup R^*$ so I need a maximal ideal containing all but two elements which seems impossible, but again I don't know how to prove it. Most of my intuition for this being false is coming from Lagrange I think. Lagrange says that subgroups can't get too large, in particular that if $|G|=n$ then any proper subgroup $H$ must have $|H| \leq n/2$. But Lagrange doesn't work for infinite groups, so I don't know if this intuition is at all valid. 
 A: If $a \neq 1$ is a unit, and $b \neq 0$ is not, then $ab$ is not a unit either; further, we cannot have $ab = 0$, thus $ab = b$. But then, since $a \neq 1$, $a - 1$ is a zero divisor, so not a unit, so $a - 1 = b$. So there can be at most one unit which is not equal to $1$. Thus if $R$ is a ring with precisely two nonunits then $3 \leq |R| \leq 4$. When combined with awllower's answer we see that the two examples in that answer are the only two, even including infinite rings.
A: Below is an alternative discussion.
Suppose $R$ is such a ring, and $\{0, x\}$ is the set of non-units of $R.$ Then any ideal that contains a unit element is the unit ideal $R,$ thus $R$ has exactly $1$ non-trivial ideal, i.e. $(x).$ (This shows that $R$ is a local artinien principal ideal ring.)
Now the nilradical of $R$ is equal to $\bigcap_{\mathfrak p\in\text{Spec} R}\mathfrak p=(x),$ thus $x^n=0,$ for some $n,$ and hence $x^2$ is a non-unit that cannot equal $x,$ as that would imply that $x^n=x\not=0, \forall n\in \mathbb N-\{0\},$ i.e. $x^2=0.$
If $2x\not=0,$ then $2x$ is a non-unit that is different from $0$ and $x$ ($2x=x$ implies that $x=0$), a contradiction. Hence $2x=0.$ So $2$ is a non-unit, and hence $2=0$ or $2=x.$  
The case $2=0$ gives us a new example: $\mathbb F_4:=\mathbb Z_2[x]/(x^2),$ where $\mathbb Z_2:=\mathbb Z/2\mathbb Z.$
The case $2=x$ gives us the example: $\mathbb Z/4\mathbb Z.$  
Thanks to @user73985's arguments, these two examples are the only two rings with this property.  
If I misunderstood at some point, or if I made some mistakes, please tell me, thanks in advance.  
A: A suggestion: Look for a commutative inverse semigroup with two identities. Then Take some Z_n and form the semigroup ring.
