Skip to main content

Section Composites of Functions

In our past mathematical experiences, we have often added and multiplied functions together (e.g., if \(f(x) = x^2\) and \(g(x) = x+1\) map from \(\R\) to \(\R\text{,}\) then \((fg)(x) = x^2(x+1)\) and \((f+g)(x) = x^2+(x+1)\)). In topology, we generally don’t care about any algebraic structure a set might have, so we will move away from sums and products, and focus on compositions of functions.
The basic idea of function composition is that, when possible, the output of a function \(f\) is used as the input of a function \(g\text{.}\) The resulting function can be referred to as “\(f\) followed by \(g\)” and is called the composite of \(f\) with \(g\text{.}\) The notation we use is \(g \circ f\) (note the order — \(f\) is applied first). For example, if
\begin{equation*} f(x) = 3x^2 + 2 \text{ and } g(x) = \sin(x)\text{,} \end{equation*}
both mapping \(\R\) to \(\R\text{,}\) then we can compute \((g \circ f)(x)\) as follows:
\begin{equation*} (g \circ f)(x) = g(f(x)) = g(3x^2 + 2) = \sin\left(3x^2 + 2\right)\text{.} \end{equation*}
In this case, \(f(x)\text{,}\) the output of the function \(f\text{,}\) was used as the input for the function \(g\text{.}\) This idea motivates the formal definition of the composition of two functions.

Definition 2.4.

Let \(A\text{,}\) \(B\text{,}\) and \(C\) be nonempty sets, and let \(f : A \to B\) and \(g : B \to C\) be functions. The composite of \(f\) and \(g\) is the function \(g \circ f : A \to C\) defined by
\begin{equation*} (g \circ f)(x) = g(f(x)) \end{equation*}
for all \(x \in A\)
We refer to the function \(g \circ f\) as a composite function, and we read \((g \circ f)(x)\) as “\(g\) of \(f\)” of \(x\text{.}\)

Activity 2.2.

Let \(A = \{1, 2, 3\}\text{,}\) \(B = \{a, b, c, d\}\text{,}\) and \(C = \{\alpha, \beta, \gamma\}\text{.}\) Define \(f : A \to B\text{,}\) \(g : A \to B\text{,}\) and \(h : B \to C\) by
\begin{equation*} f(1) = b, \ f(2) = c, \ f(3) = a\text{,} \end{equation*}
\begin{equation*} g(1) = d, \ g(2) = c, \ g(3) = d, \text{ and } \end{equation*}
\begin{equation*} h(a) = \gamma, \ h(b) = \alpha, \ h(c) = \beta, \ h(d) = \alpha\text{.} \end{equation*}

(a)

Find the images of the elements in \(A\) under the function \(h \circ f\text{.}\)

(b)

Find the images of the elements in \(A\) under the function \(h \circ g\text{.}\)

(c)

Are any of \(f\text{,}\) \(g\text{,}\) and \(h\) injections? Are any of \(f\text{,}\) \(g\text{,}\) and \(h\) surjections?

(d)

Is \(h \circ f\) an injection? Is \(h \circ f\) a surjection? Explain.

(e)

Is \(h \circ g\) an injection? Is \(h \circ g\) a surjection? Explain.
In Activity 2.2, we asked questions about whether certain composite functions were injections and/or surjections. In mathematics, it is typical to explore whether certain properties of an object transfer to related objects. In particular, we might want to know whether or not the composite of two injective functions is also an injection. (Of course, we could ask a similar question for surjections.) These questions are explored in the next activity.

Activity 2.3.

Let the sets \(A\text{,}\) \(B\text{,}\) \(C\text{,}\) and \(D\) be as follows:
\begin{equation*} A = \{ a, b, c \}, B = \{p, q, r\}, C = \{u, v, w, x \}, \text{ and } D = \{u, v \}\text{.} \end{equation*}

(a)

Construct a function \(f : A \to B\) that is an injection and a function \(g : B \to C\) that is an injection. In this case, is the composite function \(g \circ f : A \to C\) an injection? Explain.

(b)

Construct a function \(f : A \to B\) that is a surjection and a function \(g : B \to D\) that is a surjection. In this case, is the composite function \(g \circ f : A \to D\) a surjection? Explain.

(c)

Construct a function \(f : A \to B\) that is a bijection and a function \(g : B \to A\) that is a bijection. In this case, is the composite function \(g \circ f : A \to A\) a bijection? Explain.
In Activity 2.3, we explored some properties of composite functions related to injections, surjections, and bijections. The following theorem summarizes the results that these explorations were intended to illustrate.