My question actually follows from this one:
Chinese Remainder Theorem for Rings
What I don't understand is why is it necessary for $I+J=R$, in order for
$$ \varphi\colon R\to R/I\times R/J:a\mapsto (a+I,a+J) $$
to be surjective. This map seems surjective by construction (I worked through the same question myself and came up with the same homomorphism. But I didn't seem to require that $I+J=R$ in my answer).
Quoting Ben West's answer, he says:
For any $r,s\in R$, we can write $r=r_i+r_j$ and $s=s_i+s_j$, where $r_i,s_i\in I$, etc. Let $a=r_i+s_j$, so $a-r=s_j-r_j\in J$, and $a-s=r_i-s_i\in I$. In particular, $a+I=s+I$, and $a+J=r+J$. This shows that the map $$ \varphi\colon R\to R/I\times R/J:a\mapsto (a+I,a+J) $$ is surjective.
Why does $a-s \in I $ $\Rightarrow a+I = s+I $ in the above argument?
Thanks so much in advance!
If $a - s\in I$, then $a - s = x$ for some $x\in I$. Then $a = s + x$. Thus, for every $y \in I$, $a + y = s + (x + y) \in s + I$, showing that $a + I \subseteq s + I$. Similarly, $s + I \subseteq a + I$. Hence $a + I = s + I$.
If $I + J \neq R$, $\phi$ is not surjective. Just to illustrate, if $R = \Bbb Z$, $I = (3)$, and $J = (6)$, then $(2 + I, 3 + J)$ is not in the image of $\phi$. Otherwise, $\phi(a) = (2 + I, 3 + J)$ for some $a\in \Bbb Z$, which implies $a \equiv 2\pmod{3}$ and $a \equiv 3 \pmod{6}$. Since $a \equiv 3\pmod{6}$, $a = 3 + 6j$ for some $j\in \Bbb Z$. Since $3 + 6j \equiv 0 \pmod{3}$, then $a \equiv 0\pmod{3}$. This contradicts the congruence $a \equiv 2\pmod{3}$.