TITLE: What is the most general category in which exist short exact sequences?
QUESTION [10 upvotes]: Let $A,B,C$ be objects, $0$ the final object, and $f:A\to B$ and $g:B\to C$ morphisms in some category.
Consider the sequence: 
$$
0 \to A \to B \to C \to 0\;.
$$
I would like to say something analogous to:

$f$ is injective (or maybe some kind of kernel is trivial)
$g$ is surjective (or maybe some kind of cokernel is trivial)
$fg$ factors through $0$ (or something like $im (f) = ker (g)$).

Of course in the category of modules and in the category of groups all of this makes sense. what about, for example, in Sets? Or in metric spaces?
In general, which properties must my category have to have (a generalization of) exact sequences? 
(For example, I guess we need a terminal object...right?)

REPLY [6 votes]: Short exact sequences make sense in any category enriched in pointed sets, i.e. in which there is a null arrow $0\colon A\to B$ between any two objects, preserved by composition on both sides ($f\circ 0 = 0$ and $0\circ f=0$ for any composable $f$ and null arrow).  Examples are the category of pointed sets, pointed topological spaces, and categories of algebraic structures with a unique constant.
A kernel of $f\colon A\to B$ is then a universal arrow $k\colon K \to A$ such that $k\circ f = 0$.  A short exact sequence is then a sequence $A\xrightarrow{f} B\xrightarrow{g} C$ such that $f$ is a kernel for $g$ and $g$ a cokernel for $f$.
Marco Grandis has generalised this to a setting where there may be more than one null arrow between two objects.  This allows, for instance, to consider short exact sequences in the category of topological spaces equipped with a distinguished subspace, which are used in algebraic topology.  See On the categorical foundations of homological and homotopical algebra.
Note: you can define another kind of short exact sequences in a general category: a diagram $R\rightrightarrows A\to Q$, where the left-hand side is the kernel pair of the right-hand side and the right-hand side is the coequaliser of the left-hand side.