Skip to main content

Section 6.4 Composition of Functions

Beginning Activity Beginning Activity 1: Constructing a New Function

Let \(A = \left\{ {a, b, c, d} \right\}\text{,}\) \(B = \left\{ {p, q, r} \right\}\text{,}\) and \(C = \left\{ {s, t, u, v} \right\}\text{.}\) The arrow diagram in Figure 6.23 shows two functions: \(f\x A \to B\) and \(g\x B \to C\text{.}\)

Notice that if \(x \in A\text{,}\) then \(f(x) \in B\text{.}\) Since \(f(x) \in B\text{,}\) we can apply the function \(g\) to \(f(x)\text{,}\) and we obtain \(g(f(x))\text{,}\) which is an element of \(C\text{.}\)

Using this process, determine \(g(f(a))\text{,}\) \(g ( f(b) )\text{,}\) \(g ( f(c) )\text{,}\) and \(g ( f(d) )\text{.}\) Then explain how we can use this information to define a function from \(A\) to \(C\text{.}\)

Figure 6.23. Arrow Diagram Showing Two Functions

Beginning Activity Beginning Activity 2: Verbal Descriptions of Functions

The outputs of most real functions we have studied in previous mathematics courses have been determined by mathematical expressions. In many cases, it is possible to use these expressions to give step-by-step verbal descriptions of how to compute the outputs. For example, if

\begin{equation*} f\x \mathbb{R} \to \mathbb{R}\text{ is defined by } f( x ) = ( {3x + 2} )^3\text{,} \end{equation*}

we could describe how to compute the outputs as follows:

Step Verbal Description Symbolic Result
1 Choose an input. \(x\)
2 Multiply by 3. \(3x\)
3 Add 2. \(3x + 2\)
4 Cube the result. \(( {3x + 2} )^3\)

Complete step-by-step verbal descriptions for each of the following functions.

1.

\(f\x \mathbb{R} \to \mathbb{R}\) by \(f( x ) = \sqrt {3x^2 + 2}\text{,}\) for each \(x \in \R\text{.}\)

2.

\(g\x \mathbb{R} \to \mathbb{R}\) by \(g( x ) = \sin \! \left( {3x^2 + 2} \right)\text{,}\) for each \(x \in \R\text{.}\)

3.

\(h\x \mathbb{R} \to \mathbb{R}\) by \(h( x ) = e^{3x^2 + 2}\text{,}\) for each \(x \in \R\text{.}\)

4.

\(G\x \R \to \R\) by \(G(x) = \ln ( x^4 + 3 )\text{,}\) for each \(x \in \R\text{.}\)

5.

\(k \x \R \to \R\) by \(k(x) = \sqrt[3]{\dfrac{\sin (4x + 3)}{x^2 + 1}}\text{,}\) for each \(x \in \R\text{.}\)

Subsection Composition of Functions

There are several ways to combine two existing functions to create a new function. For example, in calculus, we learned how to form the product and quotient of two functions and then how to use the product rule to determine the derivative of a product of two functions and the quotient rule to determine the derivative of the quotient of two functions.

The chain rule in calculus was used to determine the derivative of the composition of two functions, and in this section, we will focus only on the composition of two functions. We will then consider some results about the compositions of injections and surjections.

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{.}\) This can be referred to as “\(f\) followed by \(g\)” and is called the composition of \(f\) and \(g\text{.}\) In previous mathematics courses, we used this idea to determine a formula for the composition of two real functions.

For example, if

\begin{equation*} f( x ) = 3x^2 + 2 \text{ and } g( x ) = \sin x\text{,} \end{equation*}

then we can compute \(g( f( x ) )\) as follows:

\begin{align*} g( {f( x )} ) \amp = g \! \left( {3x^2 + 2} \right)\\ \amp = \sin \! \left( {3x^2 + 2} \right)\text{.} \end{align*}

In this case, \(f( x )\text{,}\) the output of the function \(f\text{,}\) was used as the input for the function \(g\text{.}\) We now give the formal definition of the composition of two functions.

Definition.

Let \(A\text{,}\) \(B\text{,}\) and \(C\) be nonempty sets, and let \(f\x A \to B\) and \(g\x B \to C\) be functions. The composition of \(\boldsymbol{f}\) and \(\boldsymbol{g}\) is the function \(g \circ f\x A \to C\) defined by

\begin{equation*} ( {g \circ f} )( x ) = g\left( {f( x )} \right) \end{equation*}

for all \(x \in A\text{.}\) We often refer to the function \(g \circ f\) as a composite function.

It is helpful to think of the composite function \(g \circ f\) as “\(\boldsymbol{f}\) followed by \(\boldsymbol{g}\text{.}\)” We then refer to \(f\) as the inner function and \(g\) as the outer function.

Subsection Composition and Arrow Diagrams

The concept of the composition of two functions can be illustrated with arrow diagrams when the domain and codomain of the functions are small, finite sets. Although the term “composition” was not used then, this was done in Beginning Activity 1, and another example is given here.

Let \(A = \left\{ {a, b, c, d} \right\}\text{,}\) \(B = \left\{ {p, q, r} \right\}\text{,}\) and \(C = \left\{ {s, t, u, v} \right\}\text{.}\) The arrow diagram in Figure 6.24 shows two functions: \(f\x A \to B\) and \(g\x B \to C\text{.}\)

Figure 6.24. Arrow Diagram for Two Functions

If we follow the arrows from the set \(A\) to the set \(C\text{,}\) we will use the outputs of \(f\) as inputs of \(g\text{,}\) and get the arrow diagram from \(A\) to \(C\) shown in Figure 6.25. This diagram represents the composition of \(f\) followed by \(g\text{.}\)

Figure 6.25. Arrow Diagram for \(g \circ f\x A \to C\)

Progress Check 6.26. The Composition of Two Functions.

Let \(A = \{ a, b, c, d \}\) and \(B = \{ 1, 2, 3 \}\text{.}\) Define the functions \(f\) and \(g\) as follows:

\(f \x A \to B\) defined by \(f(a) = 2\text{,}\) \(f(b) = 3\text{,}\) \(f(c) = 1\text{,}\) and \(f(d) = 2\text{.}\)
\(g \x B \to B\) defined by \(g(1) = 3\text{,}\) \(g(2) = 1\text{,}\) and \(g(3) = 2\text{.}\)

Create arrow diagrams for the functions \(f\text{,}\) \(g\text{,}\) \(g \circ f\text{,}\) and \(g \circ g\text{.}\)

Solution.

The arrow diagram for \(g \circ f: A \to B\) should show the following:

\begin{align*} (g \circ f)(a) \amp = g(f(a)) \amp (g \circ f)(b) \amp = g(f(b))\\ \amp = g(2) = 1 \amp \amp = g(3) = 2\\ (g \circ f)(c) \amp = g(f(c)) \amp (g \circ f)(d) \amp = g(f(d))\\ \amp = g(1) = 3 \amp \amp = g(2) = 1 \end{align*}

The arrow diagram for \(g \circ g: B \to B\) should show the following:

\begin{align*} (g \circ g)(1) \amp = g(g(1)) \amp (g \circ g)(2) \amp = g(g(2))\\ \amp = g(3) = 2 \amp \amp = g(1) = 3\\ (g \circ g)(3) \amp = g(g(3))\\ \amp = g(2) = 1 \end{align*}

Subsection Decomposing Functions

We use the chain rule in calculus to find the derivative of a composite function. The first step in the process is to recognize a given function as a composite function. This can be done in many ways, but the work in Beginning Activity 2 can be used to decompose a function in a way that works well with the chain rule. The use of the terms “inner function” and “outer function” can also be helpful. The idea is that we use the last step in the process to represent the outer function, and the steps prior to that to represent the inner function. So for the function,

\begin{equation*} f\x \mathbb{R} \to \mathbb{R}\text{ by } f( x ) = ( {3x + 2} )^3\text{,} \end{equation*}

the last step in the verbal description table was to cube the result. This means that we will use the function \(g\) (the cubing function) as the outer function and will use the prior steps as the inner function. We will denote the inner function by \(h\text{.}\) So we let \(h\x \R \to \R\) by \(h( x ) = 3x + 2\) and \(g\x \R \to \R\) by \(g( x ) = x^3\text{.}\) Then

\begin{align*} ( {g \circ h} )( x ) \amp = g\left( {h( x )} \right)\\ \amp = g( {3x + 2} )\\ \amp = ( {3x + 2} )^3\\ \amp = f( x )\text{.} \end{align*}

We see that \(g \circ h = f\) and, hence, we have “decomposed” the function \(f\text{.}\) It should be noted that there are other ways to write the function \(f\) as a composition of two functions, but the way just described is the one that works well with the chain rule. In this case, the chain rule gives

\begin{align*} f'(x) \amp = ( g \circ h )'(x)\\ \amp = g'(h(x))\; h'(x)\\ \amp = 3(h(x))^2 \cdot 3\\ \amp = 9 (3x + 2)^2 \end{align*}

Progress Check 6.27. Decomposing Functions.

Write each of the following functions as the composition of two functions.

(a)

\(F\x \R \to \R\) by \(F(x) = ( x^2 +3 )^3\)

Solution.

\(F = g \circ f\text{,}\) where \(f:\R \to \R\) by \(f ( x ) = x^2 + 3\text{,}\) and \(g:\R \to \R\) by \(g(x) = x^3\text{.}\)

(b)

\(G\x \R \to \R\) by \(G(x) = \ln ( x^2 + 3 )\)

Solution.

\(G = h \circ f\text{,}\) where \(f:\R \to \R^+\) by \(f( x ) = x^2 + 3\text{,}\) and \(h:\R^+ \to \R\) by \(h(x) = \ln x\text{.}\)

(c)

\(f\x \Z \to \Z\) by \(f(x) = | x^2 - 3 |\)

Solution.

\(f = g \circ k\text{,}\) where \(k:\R \to \R\) by \(k(x) = x^2 - 3\) and \(g:\R \to \R\) by \(g(x) = |x|\text{.}\)

(d)

\(g\x \R \to \R\) by \(g(x) = \cos \! \left( \dfrac{2x-3}{x^2+1} \right)\)

Solution.

\(g = h \circ f\text{,}\) where \(f:\R \to \R\) by \(f(x) = \dfrac{2x-3}{x^2 + 1}\) and \(h:\R \to \R\) by \(h(x) = \cos x\text{.}\)

Subsection Theorems about Composite Functions

If \(f \x A \to B\) and \(g \x B \to C\text{,}\) then we can form the composite function \(g \circ f \x A \to C\text{.}\) In Section 6.3, we learned about injections and surjections. We now explore what type of function \(g \circ f\) will be if the functions \(f\) and \(g\) are injections (or surjections).

Progress Check 6.28. Compositions of Injections and Surjections.

Although other representations of functions can be used, it will be helpful to use arrow diagrams to represent the functions in this progress check. We will use the following sets:

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

Draw an arrow diagram for a function \(f \x A \to B\) that is an injection and an arrow diagram for a function \(g \x B \to C\) that is an injection. In this case, is the composite function \(g \circ f \x A \to C\) an injection? Explain.

Solution.

\(g \circ f\) should be an injection.

(b)

Draw an arrow diagram for a function \(f \x A \to B\) that is a surjection and an arrow diagram for a function \(g \x B \to D\) that is a surjection. In this case, is the composite function \(g \circ f \x A \to D\) a surjection? Explain.

\(g \circ f\) should be a surjection.

(c)

Draw an arrow diagram for a function \(f \x A \to B\) that is a bijection and an arrow diagram for a function \(g \x B \to A\) that is a bijection. In this case, is the composite function \(g \circ f \x A \to A\) bijection? Explain.

Solution.

\(g \circ f\) should be a bijection.

In Progress Check 6.28, we explored some properties of composite functions related to injections, surjections, and bijections. The following theorem contains results that these explorations were intended to illustrate. Some of the proofs will be included in the exercises.

The proof of Item 1 is Exercise 6. Item 3 is a direct consequence of the first two parts. We will discuss a process for constructing a proof of Item 2. Using the forward-backward process, we first look at the conclusion of the conditional statement in Item 2. The goal is to prove that \(g \circ f\) is a surjection. Since \(g \circ f\x A \to C\text{,}\) this is equivalent to proving that

For all \(c \in C\text{,}\) there exists an \(a \in A\) such that \(( {g \circ f} )( a ) = c\text{.}\)
Since this statement in the backward process uses a universal quantifier, we will use the choose-an-element method and choose an arbitrary element \(c\) in the set \(C\text{.}\) The goal now is to find an \(a \in A\) such that \(( {g \circ f} )( a ) = c\text{.}\)

Now we can look at the hypotheses. In particular, we are assuming that both \(f\x A \to B\) and \(g\x B \to C\) are surjections. Since we have chosen \(c \in C\text{,}\) and \(g\x B \to C\) is a surjection, we know that

\begin{equation*} \text{there exists a } b \in B \text{ such that } g( b ) = c\text{.} \end{equation*}

Now, \(b \in B\) and \(f\x A \to B\) is a surjection. Hence

\begin{equation*} \text{there exists an } a \in A \text{ such that } f( a ) = b\text{.} \end{equation*}

If we now compute \(( {g \circ f} )( a )\text{,}\) we will see that

\begin{equation*} ( {g \circ f} )( a ) = g \left( f ( a ) \right) = g ( b ) = c\text{.} \end{equation*}

We can now write the proof as follows:

Proof of Theorem 6.29, Item 2.

Let \(A\text{,}\) \(B\text{,}\) and \(C\) be nonempty sets and assume that \(f\x A \to B\) and \(g\x B \to C\) are both surjections. We will prove that \(g \circ f\x A \to C\) is a surjection.

Let \(c\) be an arbitrary element of \(C\text{.}\) We will prove there exists an \(a \in A\) such that \(( g \circ f ) ( a ) = c\text{.}\) Since \(g\x B \to C\) is a surjection, we conclude that

there exists a \(b \in B\) such that \(g( b ) = c\text{.}\)

Now, \(b \in B\) and \(f\x A \to B\) is a surjection. Hence

\begin{equation*} \text{there exists an } a \in A \text{ such that } f( a ) = b\text{.} \end{equation*}

We now see that

\begin{align*} ( {g \circ f} )( a ) \amp = g\left( {f( a )} \right)\\ \amp = g( b )\\ \amp = c\text{.} \end{align*}

We have now shown that for every \(c \in C\text{,}\) there exists an \(a \in A\) such that \(( {g \circ f} )( a ) = c\text{,}\) and this proves that \(g \circ f\) is a surjection.

Theorem 6.29 shows us that if \(f\) and \(g\) are both special types of functions, then the composition of \(f\) followed by \(g\) is also that type of function. The next question is, “If the composition of \(f\) followed by \(g\) is an injection (or surjection), can we make any conclusions about \(f\) or \(g\text{?}\)” A partial answer to this question is provided in Theorem 6.30. This theorem will be investigated and proved in the Explorations and Activities for this section. See Activity 39.

Exercises Exercises

1.

In our definition of the composition of two functions, \(f\) and \(g\text{,}\) we required that the domain of \(g\) be equal to the codomain of \(f\text{.}\) However, it is sometimes possible to form the composite function \(g \circ f\) even though \(\text{ dom} ( g ) \ne \text{ codom} ( f )\text{.}\) For example, let

\begin{align*} \amp f: \R \to \R \amp \amp \text{ be defined by } \amp \amp f( x ) = x^2 + 1, \text{ and let}\\ \amp g: \R - \left\{ 0 \right\} \to \R \amp \amp \text{ be defined by } \amp \amp g( x ) = \dfrac{1}{x} \end{align*}
(a)

Is it possible to determine \(( {g \circ f} )( x )\) for all \(x \in \mathbb{R}\text{?}\) Explain.

(b)

In general, let \(f\x A \to T\) and \(g\x B \to C\text{.}\) Find a condition on the domain of \(g\) (other than \(B = T\)) that results in a meaningful definition of the composite function \(g \circ f\x A \to C\text{.}\)

2.

Let \(h\x \mathbb{R} \to \mathbb{R}\) be defined by \(h( x ) = 3x + 2\) and \(g\x \mathbb{R} \to \mathbb{R}\) be defined by \(g( x ) = x^3\text{.}\) Determine formulas for the composite functions \(g \circ h\) and \(h \circ g\text{.}\) Is the function \(g \circ h\) equal to the function \(h \circ g\text{?}\) Explain. What does this tell you about the operation of composition of functions?

Answer.

\(( {g \circ h} ):\mathbb{R} \to \mathbb{R}\) by \(( {g \circ h} )( x ) = g( {h( x )} ) = g\!\left( {x^3 } \right) = 3x^3 + 2\text{.}\)

\(( {h \circ g} ):\mathbb{R} \to \mathbb{R}\) by \(( {h \circ g} )( x ) = h( {g( x )} ) = h( {3x + 2} ) = ( {3x + 2} )^3\text{.}\)

This shows that \(h \circ g \ne g \circ h\) or that composition of functions is not commutative.

3.

Following are formulas for certain real functions. Write each of these real functions as the composition of two functions. That is, decompose each of the functions.

(a)

\(F( x ) = \cos ( {e^x } )\)

Answer.

\(F\left( x \right) = \left( {g \circ f} \right)\left( x \right)\text{,}\) where \(f\left( x \right) = e^x\) and \(g\left( x \right) = \cos x\text{.}\)

(b)

\(G( x ) = e^{\cos ( x )}\)

Answer.

\(G\left( x \right) = \left( {g \circ f} \right)\left( x \right)\) where \(f\left( x \right) = \cos x\) and \(g\left( x \right) = e^x\text{.}\)

(c)

\(H( x ) = \dfrac{1}{{\sin x}}\)

Answer.

\(H\left( x \right) = \left( {g \circ f} \right)\left( x \right)\text{,}\) \(f\left( x \right) = \sin x\text{,}\) \(g\left( x \right) = \frac{1}{x}\text{.}\)

(d)

\(K( x ) = \cos \!\left( {e^{ - x^2 } } \right)\)

Answer.

\(K\left( x \right) = \left( {g \circ f} \right)\left( x \right)\text{,}\) \(f\left( x \right) = e^{-x^2}\text{,}\) \(g\left( x \right) = \cos x\text{.}\)

4.

The identity function on a set \(S\text{,}\) denoted by \(I_S\text{,}\) is defined as follows: \(I_S \x S \to S\) by \(I_S ( x ) = x\) for each \(x \in S\text{.}\) Let \(f\x A \to B\text{.}\)

(a)

For each \(x \in A\text{,}\) determine \(( {f \circ I_A } )( x )\) and use this to prove that \(f \circ I_A = f\text{.}\)

Answer.

For each \(x \in A\text{,}\) \(( {f \circ I_A } )( x ) = f( {I_A ( x )} ) = f( x )\text{.}\) Therefore, \(f \circ I_A = f\text{.}\)

(b)

Prove that \(I_B \circ f = f\text{.}\)

5.

Complete the following.

(a)

Let \(f\x \mathbb{R} \to \mathbb{R}\) be defined by \(f( x ) = x^2\text{,}\) let \(g\x \mathbb{R} \to \mathbb{R}\) be defined by \(g( x ) = \sin x\text{,}\) and let \(h\x \mathbb{R} \to \mathbb{R}\) be defined by \(h( x ) = \sqrt[3]{x}\text{.}\)

Determine formulas for \(\left[ ( {h \circ g} ) \circ f \right] ( x )\) and \(\left[ h \circ ( {g \circ f} ) \right] ( x )\text{.}\)

Does this prove that \(( {h \circ g} ) \circ f = h \circ ( {g \circ f} )\) for these particular functions? Explain.

Answer.

\(\left[ {( {h \circ g} ) \circ f} \right]( x ) = \sqrt[3]{{\sin ( {x^2 } )}}\text{;}\) \(\left[ {h \circ ( {g \circ f} )} \right]( x ) = \sqrt[3]{{\sin ( {x^2 } )}}\text{.}\) This proves that \((h \circ g) \circ f = h \circ (g \circ f)\) for these particular functions.

(b)

Now let \(A\text{,}\) \(B\text{,}\) \(C\text{,}\) and \(D\) be sets and let \(f\x A \to B\text{,}\) \(g\x B \to C\text{,}\) and \(h\x C \to D\text{.}\) Prove that \(( {h \circ g} ) \circ f = h \circ ( {g \circ f} )\text{.}\) That is, prove that function composition is an associative operation.

6.

Prove Item 1 of Theorem 6.29.

Let \(A\text{,}\) \(B\text{,}\) and \(C\) be nonempty sets and let \(f\x A \to B\) and \(g\x B \to C\text{.}\) If \(f\) and \(g\) are both injections, then \(g \circ f\) is an injection.

Answer.

Start of a proof: Let \(A\text{,}\) \(B\text{,}\) and \(C\) be nonempty sets and let \(f\x A \to B\) and \(g\x B \to C\text{.}\) Assume that \(f\) and \(g\) are both injections. Let \(x, y \in A\) and assume that \(( {g \circ f} )( x ) = ( {g \circ f} )( y )\text{.}\)

7.

For each of the following, give an example of functions \(f\x A \to B\) and \(g\x B \to C\) that satisfy the stated conditions, or explain why no such example exists.

(a)

The function \(f\) is a surjection, but the function \(g \circ f\) is not a surjection.

Answer.

\(f\x \mathbb{R} \to \mathbb{R}\) by \(f ( x ) = x\text{,}\) \(g: \mathbb{R} \to \mathbb{R}\) by \(g ( x ) = x^2\text{.}\) Then \(g \circ f: \R \to \R\) by \((g \circ f)(x) = x^2\text{.}\) The function \(f\) is a surjection, but \(g \circ f\) is not a surjection.

(b)

The function \(f\) is an injection, but the function \(g \circ f\) is not an injection.

Answer.

\(f: \mathbb{R} \to \mathbb{R}\) by \(f \left( x \right) = x\text{,}\) \(g: \mathbb{R} \to \mathbb{R}\) by \(g \left( x \right) = x^2\text{.}\) Then \(g \circ f: \R \to \R\) by \((g \circ f)(x) = x^2\text{.}\) The function \(f\) is an injection, but \(g \circ f\) is not an injection.

(c)

The function \(g\) is a surjection, but the function \(g \circ f\) is not a surjection.

(d)

The function \(g\) is an injection, but the function \(g \circ f\) is not an injection.

(e)

The function \(f\) is not a surjection, but the function \(g \circ f\) is a surjection.

(f)

The function \(f\) is not an injection, but the function \(g \circ f\) is an injection.

Answer.

By Item 1 of Theorem 6.30, this is not possible since if \(g \circ f\) is an injection, then \(f\) is an injection.

(g)

The function \(g\) is not a surjection, but the function \(g \circ f\) is a surjection.

(h)

The function \(g\) is not an injection, but the function \(g \circ f\) is an injection.

8.

Let \(A\) be a nonempty set and let \(f\x A \to A\text{.}\) For each \(n \in \N\text{,}\) define a function \(f^n\x A \to A\) recursively as follows: \(f^1 = f\) and for each \(n \in \N\text{,}\) \(f^{n+1} = f \circ f^n\text{.}\) For example, \(f^2 = f \circ f^1 = f \circ f\) and \(f^3 = f \circ f^2 = f \circ ( f \circ f )\text{.}\)

(a)

Let \(f\x \R \to \R\) by \(f(x) = x + 1\) for each \(x \in \R\text{.}\) For each \(n \in \N\) and for each \(x \in \R\text{,}\) determine a formula for \(f^n(x)\) and use induction to prove that your formula is correct.

(b)

Let \(a, b \in \R\) and let \(f\x \R \to \R\) by \(f(x) = ax + b\) for each \(x \in \R\text{.}\) For each \(n \in \N\) and for each \(x \in \R\text{,}\) determine a formula for \(f^n(x)\) and use induction to prove that your formula is correct.

(c)

Now let \(A\) be a nonempty set and let \(f\x A \to A\text{.}\) Use induction to prove that for each \(n \in \N\text{,}\) \(f^{n+1} = f^n \circ f\text{.}\) (Note: You will need to use the result in Exercise 5.)

Activity 38. Exploring Composite Functions.

Let \(A\text{,}\) \(B\text{,}\) and \(C\) be nonempty sets and let \(f\x A \to B\) and \(g\x B \to C\text{.}\) For this activity, it may be useful to draw your arrow diagrams in a triangular arrangement as follows:

It might be helpful to consider examples where the sets are small. Try constructing examples where the set \(A\) has 2 elements, the set \(B\) has 3 elements, and the set \(C\) has 2 elements.

(a)

Is it possible to construct an example where \(g \circ f\) is an injection, \(f\) is an injection, but \(g\) is not an injection? Either construct such an example or explain why it is not possible.

(b)

Is it possible to construct an example where \(g \circ f\) is an injection, \(g\) is an injection, but \(f\) is not an injection? Either construct such an example or explain why it is not possible.

(c)

Is it possible to construct an example where \(g \circ f\) is a surjection, \(f\) is a surjection, but \(g\) is not a surjection? Either construct such an example or explain why it is not possible.

(d)

Is it possible to construct an example where \(g \circ f\) is surjection, \(g\) is a surjection, but \(f\) is not a surjection? Either construct such an example or explain why it is not possible.

Activity 39. The Proof of Theorem 6.30.

Use the ideas from Activity 38 to prove Theorem 6.30. Let \(A\text{,}\) \(B\text{,}\) and \(C\) be nonempty sets and let \(f\x A \to B\) and \(g\x B \to C\text{.}\)

(a)

If \(g \circ f\x A \to C\) is an injection, then \(f\x A \to B\) is an injection.

Hint.

Start by asking, “What do we have to do to prove that \(f\) is an injection?” Start with a similar question for Task 39.b.

(b)

If \(g \circ f\x A \to C\) is a surjection, then \(g\x B \to C\) is a surjection.