I had to prove on a test that if $R$ is a PID then every surjective endomorphism of $R$ is an injection. To do this, I supposed there was a surjective endomorphism $\varphi:R\to R$. Then $$R/\ker\varphi\cong R$$
and I had to use the fact that $R$ is a PID to show $\ker\varphi=\{0\}$. Prior to this test, I would have assumed this implied a zero kernel regardless if $R$ were a PID or not. Therefore
I'm wondering if anybody has an example of a ring $R$ and a nontrivial ideal $I$ such that $R/I\cong R$?