Diagram 5: Chain complex and short exact sequence
A chain complex is a notation for a list of functions which can be nested:
f(g(x)) Z -- g --> X -- f --> Y.
I learned about chain complexes from Allen Hatchers "Algebraic Topology" (see below for a link) and will give you the original approach as it illustrates the most popular use of chain complexes. It goes like this:
Given a triangulation of a topological surface, we'd like to write down how surfaces are attached to edges and edges are attached to vertices. (generally, how n-cells are attached to (n-1)-cells)
This is done in a formal sum. That means it is more of a data holding structure than an actual numerical sum. But we do allow sum arthmetics so we can simplify some stuff. It's pretty much like a sum over opaque variables with the variables being names for vertices. Now we can compute a polynomial over (k-1)-cell names (a list of vertices) corresponding to a k-cell.
A short exact sequence is just a chain complex telling us f(g(z)) = 0. It is often stated as im(g) \subset ker(f), that means the output of g is a subset of those inputs of f which give zero. This is to be understood as a normalized representation for a fibration. A very simple example:
Let's fibrate a 2d plane (named Z): Let g project any point down to the x-axis, and f project to the y axis. Then f(g(x)) will be zero (the origin) for any x. Now what is im(g) / ker(f)? It is the x-axis, and each point corresponds to a fiber (a vertical line in this example), that is the points which get projected there by g.
Two more things: The zero in the following sequence is a symbol to denote a constant and in this context just means all of Z.
0 --> Z -- g --> X -- f --> Y forces g to be injective.
On the other hand, the zero on the right here really means zero:
Z -- g --> X -- f --> Y --> 0 forces f to be surjective so this one:
0 --> Z -- g --> X -- f --> Y --> 0
is a notation which shows the components of some h(x) = ker(f) / im(g). Given an h we'd like to understand we have to find f and g. In this context g and f are often called "cycle" and "boundary".
The picture below is explained in Allen Hatcher's "Algebraic Topology", an excellent free ebook: