An example of a ring homomorphism $f:R\to R'$ that is not onto, $I$ is an ideal of $R$ and $f(I)$ is an ideal of $f(R)$. My ring theory professor proved that even if a ring homomorphism $f:R \to R'$ is not onto then the image of an ideal in $R$ is an ideal of $f(R)$.  I understood the proof but I cannot think of an illustrative example. 
 A: Consider the inclusion map $\iota: \mathbb Z \hookrightarrow \mathbb Z[x]$.  Certainly $\iota$ is not onto.  Now any ideal $I \subset \mathbb Z$ is of the form $I = k\mathbb Z$ for some $k \in \mathbb Z$, and its image $\iota(I)$ is certainly an ideal of $\iota(\mathbb Z)$.
A: Well, you can take $R=R' = (\Bbb Z,+, \cdot)$, $I = \{0\}$ and $f \equiv 0$. Then $f(I) = \{0\}.$ Everything fits.
A: Here is a less trivial example: Let $R = \Bbb Z$, and let $R' = \Bbb Z_4[x]$ (polynomials with integer mod $4$ coefficients) with $f: R \to R'$ being $f(k) = k$ (mod $4$), and let $I = 2\Bbb Z$. Here, the image of $f$ consists of constant polynomials (of which there are $4$), which we identify with their constant coefficients. Note $f$ is neither surjective nor injective.
Then $f(I) = \{[0],[2]\}$, which is an ideal of $f(R) = \Bbb Z_4 = \{[0],[1],[2],[3]\}$.
A: Here are the two most extreme cases, which provide the most illustrative sets of examples in my opinion:
If $f$ is injective, then $f$ induces an isomorphism $R\to f(R)$ sending $I$ to $f(I)$, so the statement is trivial.
If $f$ sends $R$ to $0$, then $f(I)=f(R)=\{0\}$, and the statement is again trivial.
A: Another example: $R$ any integral domain not a field, $R'$ its field of fractions and $I=0$.
