I was recently reading a post on MSE which had an argument like:
If $P$ is a prime ideal of a ring $R$ all of whose elements satisfy $x^n = x$, then $R/P$ is an integral domain with the same property. This implies that $R/P$ is a finite integral domain, hence a finite field $\mathbb{F}_q$. Hence all prime ideals of $R$ are maximal (so $R$ is zero-dimensional).
Incidentally, I was trying to prove that : If $R$ is a ring such that $\forall x\in R, x^n=x$ for some $n>1$ then, every prime ideal is a maximal ideal.
However, I just don't get how can $R/P$ is finite?
Every element of $R/P$ is a root of $x^n-x$. But over an integral domain, nonzero polynomials have only finitely many roots.
In the comments, a variant of the question was raised. Suppose that we have the weaker condition that for all $x \in R$, there is some $n \in \Bbb N,n \geq 2$ (depending on $x$) such that $x^n=x$. Then we can still show that all prime ideals in $R$ are maximal, but $R/P$ might not be finite for all prime ideals $P$.
To see that $R/P$ is a field assuming that condition, we can choose $x \in R/P$ non-zero. Then we get $x^n=x$ for some $n\geq 2$. Because $R/P$ is a domain, we may cancel $x$ and get $x^{n-1}=1$. This implies that $x$ is a unit, because $1=xx^{n-2}$.
To see that $R/P$ might not be finite, consider $R=\overline{\Bbb F_p}$ (the algebraic closure of $\Bbb F_p$) and $P=0$. Here every element satisfies $x^{p^k}=x$ for some $k\in \Bbb N$.