Questions: Function Composition and Inverse Functions
5 questions to test your understanding
Score: 0 / 5
Question 1 Multiple Choice
Consider f: ℝ → ℝ defined by f(x) = x². Does f have an inverse function? Why or why not?
AYes — every function defined on ℝ has an inverse
BYes — f is surjective onto the non-negative reals, so an inverse exists
CNo — f is not injective, since f(2) = f(−2) = 4, so no unique reversal is possible
DNo — f is not surjective onto all of ℝ, and surjectivity is the only condition needed for an inverse
A function has an inverse if and only if it is a bijection — both injective AND surjective. Here, f fails injectivity: two distinct inputs (2 and −2) map to the same output (4), so there is no way to define f⁻¹(4) unambiguously. Option D is wrong because both conditions are required: surjectivity ensures f⁻¹ is total (defined everywhere on the codomain), and injectivity ensures it is well-defined (no ambiguity). Failing either one prevents an inverse.
Question 2 Multiple Choice
If g: A → B and f: B → C, what are the domain and codomain of the composition f ∘ g?
AB → B, since both functions pass through B
BA → B, inheriting g's domain and codomain
CA → C, using g's domain and f's codomain
DB → C, inheriting f's domain and codomain
Composition f ∘ g means 'first apply g, then apply f to the result.' g takes inputs from A and produces outputs in B; f then takes those B values and produces outputs in C. The overall function therefore maps from g's domain (A) to f's codomain (C): f ∘ g: A → C. The intermediate set B is consumed internally — it does not appear in the type of the composite function. This is why the output type of g must match the input type of f for composition to be well-defined.
Question 3 True / False
Function composition is associative: for functions f, g, h with compatible types, (f ∘ g) ∘ h = f ∘ (g ∘ h).
TTrue
FFalse
Answer: True
True. Associativity means the parentheses don't matter when chaining three or more functions — you always get 'apply h first, then g, then f.' This can be verified directly: ((f ∘ g) ∘ h)(x) = (f ∘ g)(h(x)) = f(g(h(x))), and (f ∘ (g ∘ h))(x) = f((g ∘ h)(x)) = f(g(h(x))). The same result. Associativity is an important algebraic property used throughout proofs, and it is one reason the collection of functions from a set to itself forms a monoid under composition.
Question 4 True / False
If f: A → B is a bijection with inverse f⁻¹: B → A, then f ∘ f⁻¹ and f⁻¹ ∘ f are the same identity function.
TTrue
FFalse
Answer: False
False — they are identity functions on different sets. f⁻¹ ∘ f = id_A (first apply f to get a B-element, then f⁻¹ to return to A), while f ∘ f⁻¹ = id_B (first apply f⁻¹ to get an A-element, then f to return to B). These are distinct functions with different domains (id_A: A → A vs. id_B: B → B). When A ≠ B, they cannot be the same function. This distinction matters in cardinality proofs, where both conditions together confirm a genuine bijection between A and B.
Question 5 Short Answer
Why does a function need to be both injective AND surjective to have an inverse? What goes wrong if only one condition holds?
Think about your answer, then reveal below.
Model answer: Injectivity ensures the inverse is well-defined: if two inputs map to the same output (f(x) = f(y) with x ≠ y), then f⁻¹ cannot map that output back to a unique input — there is ambiguity about whether f⁻¹ should return x or y. Surjectivity ensures the inverse is total: if some element y in the codomain has no preimage, then f⁻¹(y) would be undefined, so f⁻¹ wouldn't be a function at all. Both conditions together guarantee that f pairs every input with a distinct output, with every output covered — exactly what is needed to reverse the mapping unambiguously.
The two conditions address two distinct failure modes of reversal. An injective-but-not-surjective function has a well-defined but partial inverse (undefined on elements with no preimage). A surjective-but-not-injective function has a total but multi-valued 'inverse' (relations, not functions). Only a bijection avoids both problems. This is why bijections are the correct notion of 'same size' for sets: the existence of a bijection guarantees a perfect, reversible pairing.