Ideals in direct product of rings [duplicate]

If $I$ is an ideal in $R$ and $e_i=(0,\dots,0,1,0,\dots,0)$ with the $1$ in the $i$th position, then $e_iI\subseteq I$ for all $I$. It follows that $I\supseteq\sum_ie_iI$. Now $e_1+\cdots+e_n=1_R$, so if $x\in I$, we have $$x=1_Rx=(e_1+\cdots+e_n)x=e_1x+\cdots+e_nx\in \sum_ie_iI.$$ This tells us that in fact $I=\sum_ie_iI$. You should have no trouble showing that the sum is direct (and equal to the direct product)