Prime ideals in a finite direct product of rings
Solution 1:
It is clear that any ideal of $S$ of the form stated above is prime. Let $P$ be a prime ideal of $S$. For $1\leq k\leq n$, let $e_k$ be the element of $S$ whose $k$th coordinate is $1$ and all other coordinates are $0$. $P$ is proper, so some $e_j$ (say $e_1$) is not in $P$. For $k\neq 1$ we have $e_{1}e_k=0\in P$, so $e_k\in P$. Thus $0\times \prod_{i=2}^{n}{R_i}\subseteq P$. Let $\pi_1\colon S\to R_1$ be the canonical projection. Then $\pi_1(P)$ is a prime ideal of $R_1$ and $P=\pi_1(P)\times \prod_{i=2}^{n}{R_i}.$
Solution 2:
Let $R_{1}$ and $R_{2}$ be two commutative rings with unity.
Let $P$ be a prime ideal in $S=R_{1} \times R_{2}$.
Let $ P= P_{1} \times P_{2}$ where $P_{1}$ is a ideal in $R_{1}$ and $P_{2}$ is a ideal in $R_{2}$.
Then $S/P \simeq R_{1}/P_{1} \times R_{2}/P_{2} $.
In the whole quotient ring we have $(\hat 1,0)(0,\hat 1)=(0,0)$, hence one of $\hat 1$ it must be zero in the summand quotient ring which means $R_1/P_1 =0$ or $R_2/P_2 =0$. And the whole quotient ring which is integral domain will isomorphism to the non zero summand ring, which will turn to be a integral ring, hence its factor will be a prime ideal.
Therefore only one of the $P_{1}$ or $P_{2}$ is a prime ideal and other should be corresponding ring.