It's a well know fact that preimage of ideals by ring homomorphism are also ideals.
Is the reciprocal true? I.e., let $f:R\to S$ be a map between the rings $R$ and $S$ s.t. $f^{-1}(I)\vartriangleleft R$ if $I\vartriangleleft S$. Then is $f$ a ring homomorphism?
No. For instance, the function from any ring to itself which reverses the sign of each element (i.e. $f(x) = -x$) will conserve ideals, but it usually won't be a homomorphism.