MATH 308 — Lec 17 — Composition & Inverses
Math 308 · November 6, 2026
Lecture 17 — Composition and Inverse Functions
MATH 308 Bridge to Advanced Mathematics Chartrand §10.4–10.5
Goals for today. By the end of this lecture you should be able to:
-
form the composition g∘f of two functions and evaluate it correctly;
-
prove that injectivity and surjectivity are inherited by compositions — and see how much of the converse holds;
-
state what it means for a function to be invertible, and build the inverse when it exists;
-
prove the central theorem of the chapter: a function is invertible if and only if it is bijective.
Composition of functions (§10.4)
Recall from Lecture 16 that a function f:A→B assigns to each a∈A exactly one element f(a)∈B. If a second function starts where f lands, we can run them in series.
Definition 1. Let f:A→B and g:B→C. Their composition is the function g∘f:A→C defined by
(g∘f)(x)=g(f(x))for every x∈A.Read g∘f as “g after f”: apply f first, then g. For g∘f to make sense, the codomain of f must be the domain of g.
The composition g∘f follows the blue arrow, then the red one. Here (g∘f)(a3)=g(b2)=c2.
Example 1. Let f,g:R→R be f(x)=x+1 and g(x)=x2. Then
(g∘f)(x)=g(x+1)=(x+1)2,(f∘g)(x)=f(x2)=x2+1.Since (g∘f)(1)=4 but (f∘g)(1)=2, we see g∘f=f∘g: composition is not commutative. (It is associative — see the Remark below.)
Proposition 1 (Composition preserves the two properties). Let f:A→B and g:B→C.
-
If f and g are both injective, then g∘f is injective.
-
If f and g are both surjective, then g∘f is surjective.
Proof. (i) Suppose (g∘f)(x)=(g∘f)(y) for some x,y∈A; that is, g(f(x))=g(f(y)). Since g is injective, f(x)=f(y). Since f is injective, x=y. Hence g∘f is injective.
(ii) Let c∈C. Since g is surjective, there is b∈B with g(b)=c. Since f is surjective, there is a∈A with f(a)=b. Then (g∘f)(a)=g(f(a))=g(b)=c. Hence g∘f is surjective. ◻
Corollary 2. If f and g are bijective, then g∘f is bijective.
Proof. Apply both parts of Proposition 1: g∘f is injective and surjective, hence bijective. ◻
Remark 1. The converse is only half true, and knowing which half is a useful diagnostic. If g∘f is injective, then f must be injective (the “inner” map); if g∘f is surjective, then g must be surjective (the “outer” map). But the other factor can misbehave. For instance, with f:{1}→{1,2}, f(1)=1, and g:{1,2}→{1} the constant map, g∘f is a bijection {1}→{1} even though f is not surjective and g is not injective. Composition also associates: (h∘g)∘f=h∘(g∘f), since both send x↦h(g(f(x))).
The identity, and inverse functions (§10.5)
Definition 2. The identity function on a set A is idA:A→A given by idA(a)=a for all a∈A. It is the “do-nothing” map: idB∘f=f and f∘idA=f for every f:A→B.
Definition 3. A function f:A→B is invertible if there is a function g:B→A with
g∘f=idAandf∘g=idB.Such a g is called an inverse of f. Both equations are required: g must undo f and f must undo g.
Example 2. Let f:R→R, f(x)=2x+3. Guess g(x)=2x−3. Check both directions:
g(f(x))=2(2x+3)−3=x,f(g(x))=2⋅2x−3+3=x.So f is invertible with inverse g. By contrast f:R→R, f(x)=x2, is not invertible: it is neither injective (f(−1)=f(1)) nor surjective (nothing maps to −1). Restricting to f:[0,∞)→[0,∞) repairs both defects, and then g(x)=x is a genuine inverse.
An inverse simply reverses every arrow. On the graph in R2, this is the reflection across the line y=x.
f(x)=2x+3 and its inverse f−1(x)=2x−3 are mirror images across y=x.
Proposition 3 (The inverse is unique). If f:A→B has an inverse, that inverse is unique. We may therefore write it f−1.
Proof. Suppose g and h are both inverses of f. Using g∘f=idA, associativity, and f∘h=idB,
g=g∘idB=g∘(f∘h)=(g∘f)∘h=idA∘h=h.■Invertible = bijective (§10.5)
Everything above points at one theorem, and it is the reason bijections matter so much (Lecture 16, Lecture 18).
Theorem 4. A function f:A→B is invertible if and only if it is bijective.
Proof. (⇒) Suppose f is invertible, with inverse g:B→A. Injective: if f(a1)=f(a2), apply g to both sides: g(f(a1))=g(f(a2)), i.e. a1=a2 since g∘f=idA. Surjective: let b∈B. Then f(g(b))=(f∘g)(b)=b, so g(b)∈A is a preimage of b. Thus f is bijective.
(⇐) Suppose f is bijective. We build an inverse. Fix b∈B. Because f is surjective there exists a∈A with f(a)=b; because f is injective this a is the only such element. So the rule
g(b)=the unique a∈A with f(a)=bdefines a genuine function g:B→A. Now check both composites. For a∈A, put b=f(a); then g(b) is the unique preimage of b, which is a, so g(f(a))=a — that is, g∘f=idA. For b∈B, by definition f(g(b))=b, so f∘g=idB. Hence g is an inverse of f, and f is invertible. ◻
Corollary 5 (Socks and shoes). *If f:A→B and g:B→C are bijective, then g∘f is bijective and
(g∘f)−1=f−1∘g−1.Proof. g∘f is bijective, hence invertible by Theorem 4. Compute, using associativity and Proposition 3:
(f−1∘g−1)∘(g∘f)=f−1∘(g−1∘g)∘f=f−1∘idB∘f=f−1∘f=idA,and symmetrically (g∘f)∘(f−1∘g−1)=idC. So f−1∘g−1 is the inverse of g∘f. The order flips — last on, first off, like taking off shoes before socks. ◻
Homework problems
-
Let f(x)=3x−1 and g(x)=x2+1 on R. Compute (g∘f)(x) and (f∘g)(x), and evaluate each at x=2.
-
Prove directly from the definitions: if g∘f is injective, then f is injective. (Do not assume g is injective.)
-
Find the inverse of f:R→R, f(x)=2x−4, and verify both g∘f=idR and f∘g=idR.
-
Give a function f:Z→Z that is injective but not surjective, and explain why it fails to be invertible.
-
Let A={1,2,3}. Write a bijection f:A→A with f=idA, then compute f−1 and f∘f. Is f∘f=idA?
-
Using Corollary 5, if f(x)=x+5 and g(x)=2x on R, find (g∘f)−1 two ways: directly, and as f−1∘g−1.
Suggested textbook exercises (Chartrand §10.4–10.5): 10.30, 10.34, 10.38, 10.42, 10.46, 10.52.