- 1. What is a relation, really?
- 2. Types of relations: empty, universal, reflexive, symmetric, transitive
- 3. When is a relation an equivalence relation?
- 4. Sorting a set into boxes: equivalence classes
- 5. How many relations? Counting with pairs
- 6. Different inputs, different outputs: one-one (injective) functions
- 7. Is every output used? Onto (surjective) functions
- 8. Both at once: bijective functions, and the finite vs infinite surprise
- 9. How many functions? Counting maps between finite sets
- 10. One function after another: composition of functions
- 11. Running a function backwards: invertible functions
- Review
10 of 11·NCERT §1.4·5 min
One function after another: composition of functions
The big ideaIf f takes A to B and g takes B to C, the composition g∘f (NCERT writes gof) does f first and then g: \( (g \circ f)(x) = g(f(x)) \), and changing the order usually changes the answer.
In simple words
Making lemonade: first squeeze the lemons, then add sugar and water. The juice from step one is what step two works on. Joining two steps like this gives one bigger step that goes straight from lemons to lemonade. Doing the steps in the other order, adding sugar to whole lemons and then squeezing, gives something quite different.
Doing one function, then another
Let f : A → B and g : B → C. The composition of f and g is the function \( g \circ f : A \to C \) given by
\[ (g \circ f)(x) = g\big(f(x)\big) \quad \text{for every } x \in A. \]
Read it from the inside out: f acts first, then g acts on f's output. NCERT writes it without the small circle, as gof; both mean the same. The co-domain of f must sit inside the domain of g, or g would be handed outputs it can't use.
Worked example: arrows
f : {1, 2, 3, 4} → {a, b, c} with f(1) = a, f(2) = f(3) = b, f(4) = c. g : {a, b, c} → {5, 10} with g(a) = 10, g(b) = 5, g(c) = 10. Follow each arrow, then the next:
- (g∘f)(1) = g(a) = 10
- (g∘f)(2) = g(b) = 5, and (g∘f)(3) = g(b) = 5
- (g∘f)(4) = g(c) = 10
So g∘f : {1, 2, 3, 4} → {5, 10} sends 1, 4 to 10 and 2, 3 to 5. Here f∘g makes no sense at all: g's outputs 5 and 10 are not in f's domain.
Order matters
Take f, g : \( \mathbf{R} \to \mathbf{R} \) with f(x) = x + 2 and g(x) = x².
- \( (g \circ f)(x) = g(x + 2) = (x + 2)^2 \): add 2, then square.
- \( (f \circ g)(x) = f(x^2) = x^2 + 2 \): square, then add 2.
At x = 1: \( (g \circ f)(1) = 9 \) but \( (f \circ g)(1) = 3 \). So \( g \circ f \neq f \circ g \). With f(x) = sin x and g(x) = 2x: \( (g \circ f)(x) = 2\sin x \) and \( (f \circ g)(x) = \sin 2x \), which differ at \( x = \frac{\pi}{2} \) (2 against 0). Composition is not commutative.
Try it: guess first, then swap the machines and drag x along both curves.
When are two functions equal?
To claim \( g \circ f = f \circ g \) (or that any two functions are equal) you need the same domain, the same co-domain, and the same output for every input. Two different formulas can still give equal functions: on A = {0, 1}, f(x) = x² and g(x) = x agree at both points, so f = g on A.
What composition does to one-one and onto
Not in the current textbook, but JEE asks it: older NCERT editions proved these, and JEE still uses them.
- Associative: \( h \circ (g \circ f) = (h \circ g) \circ f \). Doing f, then g, then h gives the same result however you bracket it.
- Identity: with \( I_X(x) = x \), \( f \circ I_X = f \) and \( I_Y \circ f = f \) for f : X → Y.
- If f and g are both one-one, so is \( g \circ f \): different inputs stay different through both steps.
- If f and g are both onto, so is \( g \circ f \): any z in C comes from some y in B, which comes from some x in A.
- So the composition of two bijections is a bijection.
- Going backwards: if \( g \circ f \) is one-one, then f is one-one; if \( g \circ f \) is onto, then g is onto. The other function need not be. Example: A = {1}, B = {1, 2}, C = {1}, f(1) = 1, g(1) = g(2) = 1. Then \( g \circ f \) is a bijection of {1}, yet f is not onto and g is not one-one.
Try it: guess first, then wire f and g yourself and check every pair at once.
Don't mix these up
- g∘f means f first. The function written nearer to x acts first.
- g∘f can exist while f∘g does not, and when both exist they are usually different.
- From "g∘f is one-one" conclude f is one-one, not g. From "g∘f is onto" conclude g is onto, not f.
Try it. f(x) = 3x − 1 and g(x) = x² + 1 on \( \mathbf{R} \). Find \( (g \circ f)(x) \), \( (f \circ g)(x) \) and \( (f \circ f)(2) \).
Answer
- Composition g∘f (gof)
- Do f, then do g to the result.
- Identity function \( I_X \)
- Leaves every element of X where it is: \( I_X(x) = x \).
- Commutative
- Order doesn't matter; composition is not.
- Associative
- Brackets don't matter; composition is.
- Equal functions
- Same domain, same co-domain, same output at every input.
Words to know
f(x) = 2x and g(x) = x − 3 on \( \mathbf{R} \). What is \( (g \circ f)(5) \)?
- 4
- 7
- 20
If f(x) = x² and g(x) = x + 1 on \( \mathbf{R} \), which is \( (f \circ g)(x) \)?
- \( x^2 + 1 \)
- \( (x + 1)^2 \)
- \( x^2(x + 1) \)
f : A → B and g : B → C, and g∘f is onto. What must be true?
- f is onto
- g is onto
- g is one-one
Picture and video credits