# Is every commutative ring without non trivial idempotent ,local?

Is every commutative ring without non trivial idempotent ,local? I know that every local ring doesn't contain nontrivial idempotent because the number of maximal ideals in R is equal to the sum of maximals in S and T where R=ST. I thought since the ring doesn't contain nontrivial idempotent it can not be the direct product of two rings and each factor contains a maximal ideal so perhaps there us just one...

• What is wrong with $\mathbb Z$ as an example. It has no non-trivial idempotent, but isn't local. – Thomas Andrews Aug 14 '17 at 21:34

For a non-domain example, an interesting one is $\mathbb Z[x]/(x^2-1)$ lacks nontrivial idempotents, but has distinct maximal ideals.