Lately, I've been looking for nice identities involving ring homomorphisms and ideals. For example, I've been able to prove that for an epimorphism $\varphi:R\to S$ and two ideals $I,J\subset R$ we have $\varphi(I+J)=\varphi(I)+\varphi(J)$; or that for a principal ideal $(a)$, $a\in R$, we have $\varphi( (a) )=(\varphi(a))$.
Now I'm wondering what would happen to two ideals $I',J'\subset S$, using $\varphi^{-1}$. When does it hold that $\varphi^{-1}(I'+J')=\varphi^{-1}(I')+\varphi^{-1}(J')$? I got one contention:
If $r\in\varphi^{-1}(I')+\varphi^{-1}(J')$ then $\exists\, i\in\varphi^{-1}(I'),j\in\varphi^{-1}(J'):r=i+j\Rightarrow\varphi(r)=\varphi(i)+\varphi(j)\in I'+J'\Rightarrow r\in\varphi^{-1}(I'+J')$
For the other contention I first got stuck at
If $r\in\varphi^{-1}(I'+J')$ then $\varphi(r)=i'+j',i'\in I', j'\in J'$
where I have to assume $\varphi$ is surjective to say $\exists\, i,j: \varphi(i)=i',\varphi(j)=j'$.
But then I got
$\varphi(r)=\varphi(i+j)$
and I'd say I need to conclude $r=i+j$, but for that I'd need $\varphi$ to be injective (hence an isomorphism).
Is it really necessary to assume $\varphi$ is an isomorphism? I found a counterexample where $\varphi$ is injective, but nor surjective, so I'd say we need surjectivity; but I'm not able to find a counterexample where $\varphi$ is surjective, but not injective.
Any help would be appreciated. Thanks in advance.
For a counter example in which $\phi$ is injective but not surjective, consider:
$S=R\oplus R$,
$\phi(x) =(x,x)$,
$I= R\oplus 0$, and
$J=0\oplus R$.
When $\phi$ is surjective the missing inclusion may be proved as follows: write $\phi(r)=i'+j'$ and pick $s$ in $R$ such that $\phi(s)=i'$. Then $$ \phi(r-s) = j'$$ whence $r-s\in \phi^{-1}(J')$ and clearly $s\in \phi^{-1}(I').$
We then have $$ r= s +(r-s) \in \phi^{-1}(I')+\phi^{-1}(J'). $$