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?