I'm thinking about the proof of the following:
If $A,B$ are rings and the only proper ideal of $A$ is $\{0\}$ and $f:A \rightarrow B$ is a ring homomorphism then $f$ is injective.
My proof:
Assume $\ker f \neq 0$. $\ker f$ is an ideal of $A$ therefore $\ker f = A$ therefore $f = 0$. But this is not a ring homomorphism because $f(1) \neq 1$. Therefore $\ker f$ must be $0$ and $f$ is injective.
My question is this: does the fact I'm proving only hold for rings with unity? Or is there a proof that doesn't use $f(1) = 1$ to prove the same thing? Many thanks for your help.