Composition of Functions

Let A, B and C be any three sets and let f : A → B and g : B → C be any two functions. The domain of g is the co-domain of f.

Define a new function (gof) : A → C such that (gof) (a) = g(f(a)) for all a ∈ A.

Here f(a) is an element of B. ∴ g(f(a)) is meaningful. The function gof is called the composition of two functions f and g.