A ring in which all prime ideals are maximal

Let R be a commutative ring with identity. Suppose that for every aR there is an integer n2 such that an=a. Show that every prime ideal of R is maximal.