Homorphism with injective and surjective

I know the following is a true statement,

Let $f : G → G'$ be a homomorphism. If $\text{ker}(f) = \lbrace e \rbrace $ then $f$ is injective.

But I was wondering since I believe(please correct me if I'm wrong) a homorphism can be both injective and surjective. So, in the above statement could we say, ...if $\text{ker}(f) = \lbrace e \rbrace $ then $f$ is injection and surjective? I feel like I may be jumping to a conclusion that could be false.


Solution 1:

Let $G_1,G_2$ be two groups (with $|G_2|>1$),

Consider the map $\phi:G_1\to G_1\oplus G_2$, defined by $\phi(g_1)=(g_1,0).$

Here, $\phi$ is an injective homomorphism but clearly not surjective.