Composition of Functions (gof and fog)
Reading the notation
means "first apply , then apply to the result", read right to left: . Likewise . There's no reason these have to match.
A quick numerical check: with and , but .
When a composition is defined
For and , the composition is defined because every output of is a valid input for . In general, exists only when the range of sits inside the domain of .
Example: take (defined for ) and .
- , defined for every .
- , defined only for , because can't accept the negative outputs produces when .
Same two functions, different order, different domain.
Worked example
are given by and . Find and .
Solution, gof: substitute into :
fog: substitute into :
So but , a clean reminder that composition order matters.
Worked example: a function that undoes itself
If for , show that .
Solution: Substitute into itself, then multiply the top and bottom by :
So is its own inverse: applying it twice gets you back where you started.
Checking an inverse with composition
A function is the inverse of exactly when both compositions give back the input: and .
Example: for , the candidate inverse is . Checking both orders:
Properties worth knowing
| If | Then |
|---|---|
| and are both one-one | is one-one |
| and are both onto | is onto |
| is one-one | is one-one (but need not be) |
| is onto | is onto (but need not be) |
| Any three functions |
Composition is associative, as the last row says, but not commutative: and usually differ, as the first two examples on this page show. They agree in special cases, such as a function and its own inverse.
Common mistakes
- Reading left to right. The function nearest acts first: in that's .
- Confusing composition with multiplication. is , not .
- Ignoring the domain. Simplifying is only half the answer. State that it needs .
- Checking only one order for an inverse. For functions on restricted domains, can hold while fails. Check both.
Where this comes up in exams
The composition of functions is listed in the sets, relations and functions units of both the JEE Main 2026 and JEE Advanced 2026 syllabi.
Checked against JEE (Main) 2026 syllabus (NTA) and JEE (Advanced) 2026 syllabus. Syllabi can change from year to year, so confirm with the latest official notification for your exam.
- Fit it into your week with the free timetable generator.
- Mark it off as you revise in the syllabus tracker.
- See how long you have left: JEE Main 2027 (Session 1) countdown and JEE Advanced 2027 countdown.