Given two functions, f:AB and g:BC (where the codomain of the second function matches the domain of the first), the composition of the two function is a new function gf:AC defined by (gf)(x)=g(f(x)). Graphically this can viewed as follows:

Figure showing function composition.