Finitely many prime ideals $\Rightarrow$ cartesian product of local rings I'm stuck on this problem from Bosch, Algebraic Geometry and Commutative Algebra:

Let $R$ be a commutative ring containing only finitely many prime ideals and assume that a certain power of the nilradical is zero. Show that $R$ is a cartesian product of local rings.

The hint is about applying the Chinese Remainder Theorem, but where are the comaximal ideals ?
 A: Background
Here is the problem:

and the two problems it refers to:

Scanning through the book, the author uses $j(R)$ to refer to the Jacobson radical and $rad(R)$ for nilradicals, so the OP's interpretation is accurate according to the text.
What happened?
zcn's adept example of the semilocalization of $\Bbb Z$ at the complemement of $(2)\cup (3)$ readily produces a domain with just three prime ideals (generated by $0$, $2$ and $3$), and of course a domain can't factor into a direct product of rings since it lacks nontrivial idempotent elements, and yet it's not local. The nilradical is zero, but the Jacobson radical is the intersection of the ideals generated by $2$ and $3$, and it is not nilpotent.
We can speculate that the author, at some point in writing or memory, thought that this would work with finitely many prime ideals and their intersection, when actually it should be finitely many maximal ideals and their intersection. In fact, the problem will go through if we assume a nilpotent Jacobson radical and finitely many maximal ideals.
Let's see how things will work out.
but where are the comaximal ideals?
Good question indeed! The first obvious candidate is the set of maximal ideals of $R$, which are guaranteed to be comaximal. However, applying the Chinese remainder theorem then only yields an isomorphism of $R/J(R)$ with a product of fields, which isn't exactly what we hoped for. But we are talking about powers of the radical: what about powers of maximal ideals?
Then one gets the idea to check if $\{m_i^n\mid i=1\ldots k\}$ is a set of comaximal ideals, where $n$ is the smallest $n$ such that $J(R)^n=\{0\}$ and the $m_i$ are a complete irredundant set of maximal ideals of $R$. This is indeed the case, and is now your first assigment.$(\ast)$
Once this is done, you can apply the Chinese remainder theorem and conclude that $R/\cap m_i^n\cong \prod R/m_i^n$, and you have two further justifications to convince yourself of $(\ast)$:


*

*$\cap m_i^n=\{0\}$

*$R/m_i^n$ is local for each $i$.


Superfluous bonus stuff
The best you can say is this: 

A commutative ring is a finite direct product of local rings iff it is a semiperfect ring. (Here semiperfect means "has finitely many maximal ideals and idempotents lift mod $J(R)$.") 

This encompasses more direct products of local rings because there are semiperfect rings whose radicals are not nilpotent (any nonfield local domain, for example.) However, if $J(R)$ is nilpotent, then idempotents lift mod $J(R)$, so this does cover the hypotheses above.
I don't think the CRT can prove this general case. Instead, one can show that having finitely many maximal ideals means you can find a maximal set of finitely many mutually orthogonal idempotents $e_1,\ldots e_k$, such that $e_iRe_i$ is a ring in $R$ with only trivial idempotents. Combined with the lifting property, one can then show that $e_iRe_i$ is local for each $i$. Thus $R\cong \prod e_iRe_i$ yields the decomposition.

Don't forget your exercises marked by $(\ast)$s above!
