Why this lesson matters. This chapter drew 17 questions in the seven papers from NDA II 2023 to NDA II 2026. The exam asks four kinds of question: is the function one-to-one or onto, how many functions or onto functions are there between two small sets, what is โf(g(x))โ, and what is the inverse of โfโ. Six real questions are solved in section 7.
What you will be able to do
- Test whether a function is one-to-one, onto, or both (bijective).
- Count the functions, the one-to-one functions and the onto functions between two small sets.
- Find the composite functions โf \circ gโ and โg \circ fโ, and find โgโ when โg \circ fโ is given.
- Find the inverse of a bijective function in three steps.
Before you start you should know: what a function, its domain, its codomain and its range are (Chapter M5-1), and how to count choices by multiplying (Chapter M1-9).
1. One-to-one functions
A function is one-to-one (also written one-one, or injective) if different inputs always give different outputs. No output is used twice.
Test. Suppose โf(a) = f(b)โ. If this forces โa = bโ, the function is one-to-one.
- โf(x) = 2x + 3โ is one-to-one: โ2a + 3 = 2b + 3โ gives โa = bโ.
- โf(x) = x^2โ on โ\mathbb{R}โ is not one-to-one: โf(2) = f(-2) = 4โ.
On the graph: a function is one-to-one if every horizontal line cuts the graph at most once. A horizontal line at height 4 cuts the U-shaped graph of โx^2โ at two points, so โx^2โ fails.

A function that is always increasing, or always decreasing, is one-to-one.
2. Onto functions, and bijective functions
A function โf : A \to Bโ is onto (surjective) if every element of the codomain โBโ is the output of some input. In other words, the range is the whole of โBโ.
- โf : \mathbb{R} \to \mathbb{R}โ, โf(x) = 2x + 3โ is onto: any โyโ is reached by โx = \dfrac{y - 3}{2}โ.
- โf : \mathbb{R} \to \mathbb{R}โ, โf(x) = x^2โ is not onto: โ-1โ is never an output.
Whether a function is onto depends on the codomain. The same rule โf(x) = x^2โ from โ\mathbb{R}โ to โ[0, \infty)โ is onto.
A function that is both one-to-one and onto is called bijective. Only bijective functions have an inverse.
The four possible cases, drawn as arrow diagrams from โAโ to โBโ:

3. Counting functions between two small sets
Let โAโ have โmโ elements and โBโ have โnโ elements. To make a function from โAโ to โBโ, choose an image for each element of โAโ.
| What is counted | Number | Example |
|---|---|---|
| All functions from โAโ to โBโ | โn^mโ | โAโ has 2 elements, โBโ has 3: โ3^2 = 9โ |
| One-to-one functions (possible only if โm \le nโ) | โn(n-1)(n-2)\dotsโ with โmโ factors | โAโ has 2, โBโ has 3: โ3 \times 2 = 6โ |
| Onto functions when โBโ has exactly 2 elements | โ2^m - 2โ | โAโ has 3, โBโ has 2: โ8 - 2 = 6โ |
| Bijective functions (possible only if โm = nโ) | โn!โ | Both have 3: โ3! = 6โ |
Why โ2^m - 2โ? There are โ2^mโ functions in all. Only two of them are not onto: the one that sends everything to the first element of โBโ, and the one that sends everything to the second.
4. Composite functions
To form a composite, put one function inside another.
(g \circ f)(x) = g(f(x)) \qquad (f \circ g)(x) = f(g(x))
In โg \circ fโ, the function โfโ acts first and โgโ acts second. Read it from the right. The paper also writes โgof(x)โ for โg \circ f(x)โ.

Take โf(x) = x + 1โ and โg(x) = x^2โ. Then
- โg \circ f(x) = g(x + 1) = (x + 1)^2โ,
- โf \circ g(x) = f(x^2) = x^2 + 1โ.
These are different. In general โf \circ g \ne g \circ fโ.
5. The inverse function
If โfโ is bijective, its inverse โf^{-1}โ undoes it: if โf(x) = yโ then โf^{-1}(y) = xโ. So
f^{-1}(f(x)) = x \quad \text{and} \quad f(f^{-1}(x)) = x
Three steps to find the inverse.
- Write โy = f(x)โ.
- Solve this equation for โxโ in terms of โyโ.
- Swap the letters: write โxโ in place of โyโ. The result is โf^{-1}(x)โ.
For โf(x) = 2x + 3โ: โy = 2x + 3โ gives โx = \dfrac{y - 3}{2}โ, so โf^{-1}(x) = \dfrac{x - 3}{2}โ. Check: โf^{-1}(f(1)) = f^{-1}(5) = 1โ.
On the graph: the graph of โf^{-1}โ is the mirror image of the graph of โfโ in the line โy = xโ.

A useful fact. A function of the form โf(x) = \dfrac{ax + b}{cx - a}โ is its own inverse: โf(f(x)) = xโ. Look at the first and last coefficients: they are โaโ and โ-aโ.
6. Worked examples
Example 1. Let โf(x) = 3x - 2โ and โg(x) = x^2 + 1โ. Find โf \circ g(2)โ and โg \circ f(2)โ.
โf \circ g(2) = f(g(2)) = f(5) = 13โ.
โg \circ f(2) = g(f(2)) = g(4) = 17โ.
Example 2. โAโ has 3 elements and โBโ has 2 elements. How many functions are there from โAโ to โBโ? How many are onto? How many are one-to-one?
All functions: โ2^3 = 8โ. Onto: โ2^3 - 2 = 6โ. One-to-one: none, because 3 inputs cannot have 3 different outputs when only 2 outputs exist.
Example 3. Let โf(x) = \dfrac{2x + 1}{x - 3}โ for โx \ne 3โ. Show that โfโ is one-to-one and find โf^{-1}โ.
One-to-one: suppose โ\dfrac{2a + 1}{a - 3} = \dfrac{2b + 1}{b - 3}โ. Cross-multiply: โ2ab - 6a + b - 3 = 2ab - 6b + a - 3โ, so โ-7a = -7bโ and โa = bโ.
Inverse: write โy = \dfrac{2x + 1}{x - 3}โ. Then โy(x - 3) = 2x + 1โ, so โxy - 2x = 3y + 1โ and โx = \dfrac{3y + 1}{y - 2}โ. Swap the letters:
f^{-1}(x) = \frac{3x + 1}{x - 2}
Check with โx = 4โ: โf(4) = 9โ and โf^{-1}(9) = \dfrac{28}{7} = 4โ. Correct.
Example 4. If โf(x) = x + 2โ and โg \circ f(x) = x^2 + 4x + 7โ, find โg(x)โ.
We know โg(x + 2) = x^2 + 4x + 7โ. Let โu = x + 2โ, so โx = u - 2โ. Then
โg(u) = (u - 2)^2 + 4(u - 2) + 7 = u^2 - 4u + 4 + 4u - 8 + 7 = u^2 + 3โ.
So โg(x) = x^2 + 3โ. Check: โg(f(x)) = (x + 2)^2 + 3 = x^2 + 4x + 7โ. Correct.
7. From the real papers
These six questions are from the Mathematics papers of NDA & NAVAC from 2023 to 2026. Try each for 75 seconds before reading the solution.
NDA II 2023, Q42. Let โf(x) = x^2 - 1โ and โgof(x) = x - \sqrt{x} + 1โ. What is โg(15)โ equal to?
(a) 1โโ(b) 2โโ(c) 3โโ(d) 4
Solution. We need an โxโ with โf(x) = 15โ: โx^2 - 1 = 15โ gives โx = 4โ (the positive value, because โ\sqrt{x}โ must exist). Then โg(15) = g(f(4)) = 4 - \sqrt{4} + 1 = 3โ. Answer (c).
NDA I 2024, Q35. Let โA = \{1, 2, 3, 4, 5\}โ and โB = \{6, 7\}โ. What is the number of onto functions from โAโ to โBโ?
(a) โ10โโโ(b) โ20โโโ(c) โ30โโโ(d) โ32โ
Solution. Each of the 5 elements of โAโ goes to 6 or to 7, so there are โ2^5 = 32โ functions. Two of them are not onto: all to 6, and all to 7. So โ32 - 2 = 30โ. Answer (c).
NDA I 2025, Q88. Let โf = \{(1, 1), (2, 4), (3, 7), (4, 10)\}โ. Consider the following statements : I. โfโ is one-one function. II. โfโ is onto function if the codomain is the set of natural numbers. Which of the statements given above is/are correct?
(a) I onlyโโ(b) II onlyโโ(c) Both I and IIโโ(d) Neither I nor II
Solution. I: the four inputs give four different outputs 1, 4, 7, 10, so โfโ is one-one. II: the natural numbers 2, 3, 5 and many others are never outputs, so โfโ is not onto. Answer (a).
NDA II 2025, Q90. Consider the function โf(x) = \frac{10^x - 10^{-x}}{10^x + 10^{-x}}โ. What is the inverse of the function?
(a) โ\log_{10}(2x - 1)โโโ(b) โ\frac{1}{2}\log_{10}(2x - 1)โโโ(c) โ\frac{1}{4}\log_{10}\left(\frac{2x}{2 - x}\right)โโโ(d) โ\frac{1}{2}\log_{10}\left(\frac{1 + x}{1 - x}\right)โ
Solution. Write โy = f(x)โ and multiply top and bottom by โ10^xโ: โy = \dfrac{10^{2x} - 1}{10^{2x} + 1}โ. Then โy \cdot 10^{2x} + y = 10^{2x} - 1โ, so โ10^{2x} = \dfrac{1 + y}{1 - y}โ and โx = \dfrac{1}{2}\log_{10}\left(\dfrac{1 + y}{1 - y}\right)โ. Swap the letters. Answer (d).
NDA II 2026, Q99. Consider the following statements in respect of the function โf : R - \left\{\frac{3}{5}\right\} \to R - \left\{\frac{3}{5}\right\}โ such that โf(x) = \frac{3x + 2}{5x - 3}โ : I. โf(x)โ is a bijective function. II. โf^{-1}(x) = f(x)โ Which of the statements given above is/are correct?
(a) I onlyโโ(b) II onlyโโ(c) Both I and IIโโ(d) Neither I nor II
Solution. Write โy = \dfrac{3x + 2}{5x - 3}โ. Then โy(5x - 3) = 3x + 2โ, so โx = \dfrac{3y + 2}{5y - 3}โ. Every โy \ne \frac{3}{5}โ comes from exactly one โxโ, so โfโ is bijective. The inverse has the same formula as โfโ. This is the useful fact of section 5 with โa = 3โ. Answer (c).
NDA II 2026, Q100. Let โAโ and โBโ be the sets having only 2 and 3 elements respectively. What is the total number of mappings from โAโ to โBโ?
(a) โ4โโโ(b) โ6โโโ(c) โ8โโโ(d) โ9โ
Solution. Each of the 2 elements of โAโ can go to any of the 3 elements of โBโ: โ3 \times 3 = 3^2 = 9โ. Answer (d).
8. Mistakes that cost marks
- Reading โg \circ fโ in the wrong order. In โg \circ f(x) = g(f(x))โ the function โfโ acts first. With โf(x) = x + 1โ and โg(x) = x^2โ, โg \circ f(2) = g(3) = 9โ, not โf(4) = 5โ.
- Taking โf^{-1}(x)โ as โ\dfrac{1}{f(x)}โ. The inverse function undoes โfโ. For โf(x) = 2xโ, โf^{-1}(x) = \dfrac{x}{2}โ, not โ\dfrac{1}{2x}โ.
- Writing โm^nโ for the number of functions. From a set of โmโ elements to a set of โnโ elements there are โn^mโ functions: the number of choices, raised to the number of inputs.
- Calling a function onto without looking at the codomain. โf(x) = x^2โ is not onto โ\mathbb{R}โ, but it is onto โ[0, \infty)โ.
9. Quick check
Do these without help. Answers are at the end.
- Let โf(x) = 2x + 1โ and โg(x) = x^2โ. Find โg \circ f(3)โ and โf \circ g(3)โ.
- Find the inverse of โf(x) = 5x - 4โ.
- โAโ has 3 elements and โBโ has 4 elements. How many functions are there from โAโ to โBโ? How many of them are one-to-one?
- Is โf : \mathbb{R} \to \mathbb{R}โ, โf(x) = x^3โ bijective?
- Let โf(x) = \dfrac{x + 1}{x - 1}โ for โx \ne 1โ. Find โf(f(x))โ.
10. Read and watch more, free
| What | Where | Language |
|---|---|---|
| Textbook | NCERT Class 12 Mathematics, Chapter 1 Relations and Functions ยท Hindi edition | English, Hindi |
| Self-study notes | NIOS Mathematics, Lesson 23 Relations and Functions-II ยท Hindi edition | English, Hindi |
| Video, the chapter for NDA | NDA Vijay by Unacademy: Maths Free Milestone Batch (the class named Functions, about 3 hours 35 minutes) | Hinglish |
| Video, the chapter for NDA | Maths Jugad Se: NDA 2 2026 Maths Calculus (the class named Function, about 4 hours) | Hinglish |
| Past NDA questions | ExamSIDE: Functions | English |
The videos were chosen from their titles, length and views; they have not yet been watched by a teacher.
Answers to the quick check
- โg \circ f(3) = g(7) = 49โ and โf \circ g(3) = f(9) = 19โ.
- โy = 5x - 4โ gives โx = \dfrac{y + 4}{5}โ, so โf^{-1}(x) = \dfrac{x + 4}{5}โ.
- All functions: โ4^3 = 64โ. One-to-one: โ4 \times 3 \times 2 = 24โ.
- Yes. It is always increasing, so it is one-to-one, and every real number โyโ is the cube of โ\sqrt[3]{y}โ, so it is onto.
- โf(f(x)) = xโ. The function has the form โ\dfrac{ax + b}{cx - a}โ with โa = 1โ, so it is its own inverse.
Next chapter: Limits.