When does a ring homomorphism preserve ideals In my textbook they say that if $f: R \rightarrow S$ is a ring homomorphism, then:
if $I \subset R$ is an left ideal of $R$, then $f(I)$ is a left ideal of $S$. 
However, I think that this is a mistake and that $f$ should be surjective for this to hold.
I have the following argument
Let $I$ be the identity map from $(\mathbb{Z},+,\cdot)$ to $(\mathbb{R},+,\cdot)$. It is known that $n\mathbb{Z}$ is an ideal from $(\mathbb{Z},+,\cdot)$. Thus, $I(n\mathbb{Z}) = n\mathbb{Z}$ should be an ideal of $(\mathbb{R},+, \cdot)$. However, since $\mathbb{R},+,\cdot$ is a field, it only has trivial left ideals, which contradicts that $n\mathbb{Z}$ is a left ideal, this because it is nontrivial. 
So, my question is whether it is a mistake in my book or whether there is a hole in my argument?

Indeed the statement "$f(I)$ is an ideal of $f(R)$" [the statement that was in the original version of the question] is true. First let's think what it means for $I$ to be to be a (left) ideal of $R$
1) $I \subset R$ 
2) For all $x \in I,r \in R, r \cdot x \in I$
So what about $f(I)$? Well
1) $f(I) \subset f(R)$ should be clear
For 2), let $x' \in f(I) = f(x)$ and $r' \in f(R) = f(r)$. Then
$$r' \cdot x' = f(r) \cdot f(x) = f(r \cdot x) \in f(I),$$
since $r \cdot x \in I$, and hence $f(I)$ is a left ideal of $f(R)$
Edit: I see you've updated the question. Indeed for it to be an ideal is $S$, it would have to be surjective
