I know that for $f\colon X \to Y$, where $e_Y$ is the identity of $Y$:
$$ \ker(f) = \left\{x \in X \, \middle| \, f(x) = e_Y \right\} $$
I've learnt that kernels imply how much a homomorphism fails to be injective. But why is a function non-injective iff $|\ker(f)| > 1$? I can naively think of functions that don't work accordingly.
Most answers answer
$$|\ker(f)| > 1 \Rightarrow \text{f is non-injective}$$ which seems trivial to me, but I'm much more interested in
$$\text{f is non-injective} \Rightarrow |\ker(f)| > 1$$
i.e. why is there no such case, where only one element is mapped to identity, but the other elements have more elements mapped to them. Let's say a group homomorphism $f\colon \mathbb{Q} \to \mathbb{Z}$, both closed under addition, where $\forall x,n \in \mathbb{Z}. f(n) = f(\frac{x}{n}) = n$. It seems to me that $|\ker(f)| = 1$, however $f$ fails to be injective.