Let $A$ a finite ring and $f:A\to A$ an homomorphism. I'm trying to show that $$f \text{ injective}\iff f \text{ surjective.} $$
I proved that $f$ is injective iff $\ker f=\{0\}$. Indeed, suppose $f$ injective. Then $$x\in\ker f\implies f(x)=0=f(0)\implies x=0\implies \ker f\subset \{0\}$$ and thus $\ker f=\{0\}$. Now if $\ker f=\{0\}$, then $$f(x)=f(y)\implies f(x-y)=0\implies x-y\in\ker f\implies x=y,$$ and thus $f$ injective. Now i'm trying to prove that $$f\text{ surjective}\iff\ker f=\{0\},$$ but with no success. Thanks for help.