I am searching for requirements that a ring homomorphism $f: A \to B$ must meet in order that it maps arbitrary ideals $I \subset A$ to ideals $f(I) \subset B$.
My thought was that the requirement is that $f$ must be surjective. That is
$f$ surjective $\Longleftrightarrow f(I)$ ideal in $B$
The $\Rightarrow$ direction was easy and straightforward (in fact there are multiple questions here that deal with this direction).
I'm struggling with showing that $f$ is surjective if we require $f(I)$ ideal in $B$. Especially for non-trivial elements in $B$ that are not contained in $f(I)$.
My initial assumption that $f$ should be surjective might also be wrong, I'm not sure since I am unable to prove $\Leftarrow$. Can you hint me into the right direction?