Let $C$ be a category with a null object. A kernel of a morphism $f:a\to b$ is an equalizer of the morphisms $f,0:a\to b$. In other words, it is a morphism $k:s\to a$ such that $fk=0$ and every $h:c\to a$ with $fh=0$ factors uniquely through $k$:

Since $k:s\to a$ is an equalizer, the morphism $k$ is a monomorphism (i.e., left cancellable). It is thus common to think of the kernel $k:s\to a$ as a subobject of $a$, although technically subobjects of $a$ are equivalence classes of monomorphisms.

Example in $\mathbf{\text{Grp}}$

In $\mathbf{\text{Grp}}$, the kernel of a group morphism $\varphi :G\to H$ is the inclusion $k:\mathrm{ker}(\varphi )\to G$, where $\mathrm{ker}(\varphi )=\{g\in G\mid \varphi (g)={e}_{H}\}$ is the usual kernel.

Example in $Ab$-categories

In any $Ab$-category $A$, all equalizers are kernels. This is because the hom-set ${\mathrm{Hom}}_{A}(b,c)$ is an abelian group, and so for arrows $f,g:b\to c$ and $h:a\to b$ we have $fh=gh$ exactly when $(f-g)h=0$. The arrow $h$ can therefore be described either as the equalizer of $f$ and $g$, or as the kernel of $f-g$. This is why we usually deal with kernels (and not equalizers) in $R\mathbf{\text{-Mod}}$, $\mathbf{\text{Ab}}$, etc.

If we dualize the notion of kernel we obtain the notion of cokernel:

Definition of cokernel

Let $C$ be a category with a null object. A cokernel of a morphism $f:a\to b$ is a coequalizer of the morphisms $f,0:a\to b$. In other words, it is a morphism $u:b\to e$ such that $uf=0$ and every $h:b\to c$ with $hf=0$ factors uniquely through $u$:

Example in $\mathbf{\text{Ab}}$

In $\mathbf{\text{Ab}}$, the cokernel of $f:A\to B$ is the projection $u:B\to B/f(A)$.

Abelian categories

Definition of an abelian category

An abelian category is an $Ab$-category satisfying the following conditions:

$A$ has a null object.

$A$ has binary biproducts.

Every morphism in $A$ has a kernel and a cokernel.

Every monomorphism is a kernel and every epimorphism is a cokernel.

The first two conditions ensure $A$ is an additive category. The existence of kernels (and binary products) then implies $A$ has all finite limits, while the existence of cokernels (and binary coproducts) implies the existence of all finite colimits.

The fourth condition is strong. It implies that any morphism $f$ that is both monomorphism and epimorphism is an isomorphism.

Examples of abelian categories

The categories $\mathbf{\text{Ab}}$, $R\mathbf{\text{-Mod}}$, and many others are abelian, with the usual kernels and cokernels.

If $A$ is an abelian category, then so is any functor category ${A}^{\mathcal{J}}$. See page 199 in Mac Lane for the short proof.

Examples of additive categories that are not abelian

The category of even-dimensional vector spaces over a field $F$ is additive but not abelian, since linear transformations with odd rank do not have kernels in that category.

The category of finitely generated modules over a non-Noetherian ring (such as $\mathbf{Q}[{x}_{1},{x}_{2},\dots ]$) is also additive but not abelian.