# Let $R$ be a commutative ring such that for each $a\in R$ there exists a positive integer $n$ such that $a^n=a$ [duplicate]

Let $R$ be a commutative ring such that for each $a\in R$ there exists a positive integer $n>1$ (depending on $a$) such that $a^n=a$. Prove that every prime ideal is a maximal ideal.

My try: Let $P$ be a prime ideal. Let $P\subset Q \subseteq R$. Then there exists $q\in Q$ but $q\notin P$. Then $\exists n$ such that $q^n=q\implies q(q^{n-1}-1)=0\in P$ since $P$ is prime either $q\in P$ or $q^{n-1}-1\in P$.

Thus $q^{n-1}-1\in P$. How to complete the proof from here?

## marked as duplicate by user26857, rschwieb abstract-algebra StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Sep 29 '15 at 18:38

$q^{n-1}-1\in P$ implies $1 \in \langle P,q \rangle \subseteq Q$ and so $Q=R$.

Alternatively, $a^n=a$ implies $a^n \equiv a \bmod P$. If $a\notin P$, then $a^{n-1}\equiv 1 \bmod P$ because $R/P$ is a domain. But then $a$ is a unit mod $P$ and so $R/P$ is a field.