TITLE: Ring without $1$ where $\forall r\in R$, $\exists$ $n_r > 1$ such that $r^{n_r} = r$, and not all primes are maximal
QUESTION [8 upvotes]: On my algebra final exam, there was a problem that essentially asked the following:

Let $R$ be a commutative ring such that for all $r\in R$, there exists $n_r\in\Bbb{Z}^{>1}$ with $r^{n_r} = r$. Prove that all prime ideals are maximal.

The solution which I believe was desired goes like this:

Let $\mathfrak{p}\subseteq R$ be prime. Take $a\in R\setminus\mathfrak{p}$, and consider $a + \mathfrak{p} = a^{n_a} + \mathfrak{p}\in R/\mathfrak{p}$. As a ring mod a prime ideal is an integral domain has no zero divisors, we can cancel. Assuming that $R$ has unity, we find $1 + \mathfrak{p} = a^{n_a - 1} + \mathfrak{p}$, and since $n_a > 1$, we can write
  $$
a\cdot a^{n_a - 2} + \mathfrak{p} = \left(a + \mathfrak{p}\right)\left(a^{n_a - 2} + \mathfrak{p}\right) = 1 + \mathfrak{p},
$$
  so we have found an inverse for any nonzero element in $R/\mathfrak{p}$. Since $R/\mathfrak{p}$ is commutative, $R/\mathfrak{p}$ is a field, and hence $\mathfrak{p}$ is maximal.

I had a problem with the cancellation step. It seems to require $R$ that have unity, whereas the problem statement does not require $R$ to have unity. I think this was a misstatement on my professor's part, but I cannot seem to find a counterexample. It isn't too much trouble to find an $R$ (without unity) with the property that for all $ r\in R$, there exists $ n_r\in\Bbb{Z}^{> 1}$ such that $r^{n_r} = r$: take for example, the subring of $\left(\Bbb{Z}/p\Bbb{Z}\right)^{\Bbb{N}}$ (countably infinite product of $\Bbb{Z}/p\Bbb{Z}$'s) where all but finitely many entries in a "vector" are nonzero.
It's easy to see that this ring does not have unity; however, it still satisfies the property that every prime ideal is maximal. I tried to come up with a genuine counterexample, but I couldn't find one. My idea was to modify the example above by considering an infinite product of some integral domain $\mathcal{O}$ (not a field) where $a^{n_a} = a$ for some $n_a > 1$ for each $a\in\mathcal{O}$, but I couldn't find such an $\mathcal{O}$. So long story short, my question is:

Is there a counterexample to the original claim when $R$ does not have $1$?

REPLY [7 votes]: Quotienting  out by a prime ideal in the candidate ring $R$, we reduce ourselves to the following question:
If $R$ is a commutative ring with no zero divisors for which $r^{n_r} = r$ for some $n_r > 1$ and all $r \in R$, then is $R$ simple?
Choose $r \neq 0$ in $R$, and let $s$ be any other element of $R$.
Then $r^{n_r} s = r s,$ and so cancelling $r$ from both sides (possible since $r$ is non-zero), we have $r^{n_r -1} s = s$.  Here $s$ is arbitrary, and so in fact we find that $R$ admits a unit, namely $r^{n_r - 1}$.   Thus $R$ is actually a field (by the argument in the OP) and so is simple.  
So there is no counterexample.