Let $X$ be a finite group and $\phi : X \longrightarrow X$ an endomorphism. I read somewhere that if $\phi$ is injective, then it is also surjective, and thus bijective. I have seen a lot of proof on this topic, but never in group theory.
I know that $\phi$ being injective means that 2 elements of $X$ can't have the same image. But how does this imply that $\phi$ is surjective ?