Reversing a Composition
Let \(f:A\to B\) and \(g:B\to C\) be bijections. Their composition \(g\circ f:A\to C\) applies \(f\) first and \(g\) second. To undo that process, we must first undo \(g\), then undo \(f\). This suggests that the inverse of \(g\circ f\) should be \(f^{-1}\circ g^{-1}\), with the order reversed.
The formula is meaningful because the domains and codomains fit: \(g^{-1}:C\to B\), and \(f^{-1}:B\to A\), so \(f^{-1}\circ g^{-1}\) maps \(C\) to \(A\). The inverse function \(f^{-1}\) is defined here only because \(f\) is bijective, as established in “Inverse Functions.” This notation is different from \(f^{-1}[S]\), which denotes the preimage of a set and is defined even when \(f\) is not bijective.
The Inverse of a Composition
The candidate can be verified using the cancellation identities for inverse functions. For a bijection \(f\), those identities are \(f^{-1}\circ f=\operatorname{id}_A\) and \(f\circ f^{-1}=\operatorname{id}_B\). Checking both orders of composition confirms that the candidate is an inverse on the correct domain and codomain.
Proof. Since \(f\) and \(g\) are bijections, they are both injective and surjective. By the earlier results on injectivity and surjectivity of compositions, \(g\circ f\) is injective and surjective, hence bijective. Therefore it has an inverse function.
Set \(h=f^{-1}\circ g^{-1}:C\to A\). We check the two cancellation identities for \(g\circ f\). By associativity of composition and the cancellation identities for \(f\) and \(g\),
In the other order, the same identities give
Thus \(h\) satisfies both cancellation identities for the bijection \(g\circ f\). By the uniqueness result for a function satisfying these identities, \(h\) is its inverse. Therefore \((g\circ f)^{-1}=f^{-1}\circ g^{-1}\). \(\square\)
Both identities matter: the first shows that undoing the composite after applying it returns every element of \(A\), and the second shows that applying the composite after undoing it returns every element of \(C\). The domains \(A\) and \(C\) need not be the same, so these are different identity functions.
Worked Example: A Composite of Real-Valued Bijections
Define \(f:\mathbb R\to\mathbb R\) and \(g:\mathbb R\to\mathbb R\) by \(f(x)=x^3+1\) and \(g(x)=2x-3\). Both functions are bijections. Solving \(y=x^3+1\) for \(x\) gives \(f^{-1}(y)=\sqrt[3]{y-1}\), while solving \(y=2x-3\) gives \(g^{-1}(y)=(y+3)/2\).
The composite is
Solving \(y=2x^3-1\) for \(x\) gives \((g\circ f)^{-1}(y)=\sqrt[3]{(y+1)/2}\). The composition formula gives the same answer:
For example, at \(y=15\), both expressions give \(\sqrt[3]{8}=2\). Indeed, \((g\circ f)(2)=2(8)-1=15\), so the inverse correctly returns \(2\).
Checking the Order and the Types
The order in the formula follows from the order in which functions act. In \(g\circ f\), the first step is \(f\) and the last step is \(g\). Reversing the process means applying \(g^{-1}\) first and \(f^{-1}\) second. Since composition notation lists the function applied first on the right, the inverse is \(f^{-1}\circ g^{-1}\).
The domains and codomains are a useful check against an order error. The inverse of \(g\circ f\) must map \(C\) to \(A\). The expression \(f^{-1}\circ g^{-1}\) has exactly this type:
By contrast, \(g^{-1}\circ f^{-1}\) is generally not even defined: \(f^{-1}\) maps \(B\) to \(A\), but \(g^{-1}\) expects an input in \(C\). Even when the sets happen to coincide so that the reversed expression can be formed, it need not give the inverse.
Worked Example: Inverse Maps on Finite Sets
Let \(A=\{p,q,r\}\), \(B=\{1,2,3\}\), and \(C=\{\alpha,\beta,\gamma\}\). Define bijections by
Applying \(f\) and then \(g\) gives
The inverse of this composite sends \(\gamma\) to \(p\), \(\alpha\) to \(q\), and \(\beta\) to \(r\). The component inverses are \(g^{-1}(\beta)=1\), \(g^{-1}(\gamma)=2\), \(g^{-1}(\alpha)=3\), and \(f^{-1}(1)=r\), \(f^{-1}(2)=p\), \(f^{-1}(3)=q\). For instance,
Likewise, \((f^{-1}\circ g^{-1})(\alpha)=f^{-1}(3)=q\) and \((f^{-1}\circ g^{-1})(\beta)=f^{-1}(1)=r\). These are exactly the values of \((g\circ f)^{-1}\), confirming the formula on every element of \(C\).
More Than Two Functions
The same reasoning applies to longer sequences. Each time a new function is added to the end of a composition, its inverse is placed at the beginning of the inverse composition. Associativity, established earlier in “Composition of Functions,” allows us to group the original composition in either order without changing the function.
Proof. By the Inverse of a Composition theorem, the inverse of \((k\circ g)\circ f\) is \(f^{-1}\circ(k\circ g)^{-1}\). Applying that theorem to \(k\circ g\) gives \((k\circ g)^{-1}=g^{-1}\circ k^{-1}\). Substitution yields
where the final grouping is justified by associativity. Since \((k\circ g)\circ f=k\circ g\circ f\), this is the claimed formula. \(\square\)
Worked Example: Why Reversing the Order Matters
Define \(f:\mathbb R\to\mathbb R\) by \(f(x)=x+1\) and \(g:\mathbb R\to\mathbb R\) by \(g(x)=2x\). Their inverses are \(f^{-1}(x)=x-1\) and \(g^{-1}(x)=x/2\). Since \(g\circ f\) first adds \(1\) and then doubles,
The theorem gives
as required. If the order is mistakenly left unchanged, then
At \(y=0\), the correct inverse gives \(-1\), while the incorrectly ordered expression gives \(-1/2\). Substitution confirms the difference: \((g\circ f)(-1)=0\), but \((g\circ f)(-1/2)=1\), not \(0\). The order reversal is essential, not just a notational convention.
When the Formula Can Be Used
The inverse-of-a-composition formula requires both component functions to be bijections, so that both inverse functions exist with the stated domains and codomains. It is not enough that a composite happens to be bijective if the individual functions are not. For example, let \(f:\{1\}\to\{1,2\}\) be given by \(f(1)=1\), and let \(g:\{1,2\}\to\{1\}\) be the constant function \(g(1)=g(2)=1\). Then \(g\circ f\) is the identity on \(\{1\}\), which is a bijection, yet neither \(f\) nor \(g\) is a bijection, so the expression \(f^{-1}\circ g^{-1}\) is unavailable as a composition of inverse functions.
Keep the distinction between inverse functions and preimages of sets in view. The notation \(f^{-1}[S]\) for a set \(S\) means the set of inputs whose \(f\)-values lie in \(S\); it does not assert that \(f\) has an inverse function. The formula in this tutorial concerns inverse functions and is used only when the functions are bijective.
Check Your Understanding
Use the domains, codomains, and cancellation identities to justify each answer.
- For bijections \(f:A\to B\) and \(g:B\to C\), state the formula for \((g\circ f)^{-1}\) and give its domain and codomain.
- Why must the order of the inverse functions be reversed?
- If \(f(x)=x-4\) and \(g(x)=3x\) on \(\mathbb R\), write the inverse of \(g\circ f\) using \(f^{-1}\) and \(g^{-1}\).
- In the proof of the Inverse of a Composition theorem, what does each of the two cancellation identities verify?
- State the inverse formula for a composition of three bijections \(f:A\to B\), \(g:B\to C\), and \(k:C\to D\).