I'm reading Mac Lane's "Categories for the Working Mathematician". I found the following sentence in page 59 of it:
Similarly, the kernel of a homomorphism (in $\mathbf{Ab}$, $\mathbf{Grp}$, $\mathbf{Rng}$, $R$-$\mathbf{Mod}$, . . .) is a universal, more exactly, a universal for a suitable contravariant functor.
I know how to express a quotient by a universal property in a category. But I really have trouble understanding how to express the kernel of a homomorphism as having a universal property.
Let $f : G \to H$ be a homomorphism of abelian groups. The kernel of $f$ is a pair $(K,i)$, consisting of an abelian group $K$, namely $\{g \in G : f(g)=0\}$, and a homomorphism $i : K \to G$, the inclusion, with $fi = 0$. Here, I denote with $0$ the trivial homomorphism. If $(T,j)$ is another such pair, there is a unique homomorphism $k : T \to K$ such that $ik=j$. (Draw a diagram!) This is because $f(j(t))=0$ implies $j(t) \in K$, etc. This is the universal property of the kernel.
How to interpret this as a universal element of a functor? Well, consider the functor $\mathsf{Grp}^{\mathrm{op}} \to \mathsf{Set}$ which maps to each group $T$ the set of all homomorphisms $j : T \to G$ with $fj=0$. The action on morphisms is clear. In fact, this will be a subfunctor of $\hom(-,G)$. Then, the kernel $(K,i)$ is a universal element of this functor.