Types of functions
NCERT Class 12 Mathematics Chapter 1 Section 1.3
Quick answer
The types of functions f : X → Y in Class 12 and JEE Main are one-one (injective), many-one, onto (surjective), into and bijective functions. A function is one-one if different elements of X have different images, that is f(x) = f(x) forces x = x, and many-one otherwise; it is onto if every element of Y is the image of some element of X, so that its range is the whole of Y, and into if it is not onto. A bijective function is both one-one and onto, and for a finite set X, a function from X to itself is one-one exactly when it is onto.
With your textbook
NCERT Mathematics Part I (Class 12), Chapter 1 “Relations and Functions”, Section 1.3 “Types of Functions”, pages 7–11.
Open the official NCERT chapter (PDF, 1.4 MB, ncert.nic.in) (opens in a new tab)
Checked against the 2026-27 reprint on .
What are one-one and onto functions?
One-one and onto functions
A function f : X → Y is defined to be one-one (or injective), if the images of distinct elements of X under f are distinct, i.e., for every x, x ∈ X, f(x) = f(x) implies x = x. Otherwise, f is called many-one.
NCERT Mathematics Part I (Class 12), Section 1.3, page 7
A function f : X → Y is said to be onto (or surjective), if every element of Y is the image of some element of X under f, i.e., for every y ∈ Y, there exists an element x in X such that f(x) = y.
NCERT Mathematics Part I (Class 12), Section 1.3, page 7
- A function that is both one-one and onto is bijective (NCERT Definition 7, page 8).
In plain words: every function already gives each input exactly one output. One-one adds a rule for the outputs: no output is shared by two inputs. Onto adds a rule for the codomain: every element of Y is an output of something. So f is onto exactly when its range is the whole codomain Y.
f : X → Y is onto if and only if Range of f = Y.
NCERT Mathematics Part I (Class 12), Section 1.3, page 8
NCERT Fig 1.2 (page 8) shows four functions from X = {1, 2, 3, 4}, one of each kind; they are redrawn below.
One-one and many-one functions
To prove one-one, start from f(x) = f(x) and show that x = x. NCERT Example 8 (page 8): for f(x) = 2x on N, 2x = 2x gives x = x.
To prove many-one, find two different inputs with the same image. NCERT Example 11 (page 9): for f(x) = x2 on R, f(−1) = 1 = f(1).
Checking only some inputs does not prove one-one: f(1) ≠ f(2) says nothing about other pairs. Use two general inputs, or check every distinct pair when the domain is a small finite set.
On a graph (JEE). Beyond the NCERT text, the same test reads off the graph of a real function: f is one-one exactly when no horizontal line meets the graph more than once, because a line y = k meeting it twice means two inputs with the one image k. This is the vertical line test of Class 11 turned on its side. And f is onto R exactly when every horizontal line meets the graph at least once.
Onto and into functions
To prove onto, take any y in the codomain, solve f(x) = y for x, and check that this x lies in the domain. NCERT Example 9 (page 9): for f(x) = 2x on R, any real y is the image of y/2.
To prove not onto, find one element of the codomain that is never reached. For f(x) = 2x on N, the number 1 would need x = 1/2, which is not in N (NCERT Example 8). For x2 on R, −2 is never reached, because x2 ≥ 0 (NCERT Example 11).
The codomain is part of the function. x2 from R to R is not onto, but x2 from R to [0, ∞) is onto, because each y ≥ 0 is the image of √y.
NCERT Example 7 (page 8): a class has 50 students with roll numbers 1 to 50, and f : A → N gives each student’s roll number. Two students never share a roll number, so f is one-one; 51 is no student’s roll number, so f is not onto.
- NCERT slip (page 8): Example 7’s solution says 51 “can not be image of any element of X under f”. The domain in that example is A, the set of students; there is no set X. Read it as “any element of A”.
Into functions (JEE). The JEE Main 2027 syllabus (Unit 1) names into functions alongside one-one and onto functions. NCERT does not define into functions; the word is commonly used for a function that is not onto, whose range is a proper subset of the codomain. In that sense NCERT’s f and f in Fig 1.2, and Examples 7, 8 and 11, are into functions. Combining the two tests gives four kinds:
| Function | Onto | Into |
|---|---|---|
| One-one | 2x on R | 2x on N |
| Many-one | NCERT Example 10 | x2 on R |
NCERT Example 10 (page 9) is f : N → N with f(1) = f(2) = 1 and f(x) = x − 1 for x > 2. It is not one-one, since f(1) = f(2), but it is onto, since any y is the image of y + 1.
Bijective functions
A function f : X → Y is said to be one-one and onto (or bijective), if f is both one-one and onto.
NCERT Mathematics Part I (Class 12), Section 1.3, page 8
A bijection pairs off the elements of X and Y exactly, one to one, with nothing left over on either side. NCERT’s f in Fig 1.2 and f(x) = 2x on R (Example 9) are bijective.
NCERT Example 12 (pages 9–10): f : N → N with f(x) = x + 1 for odd x and x − 1 for even x swaps 1 with 2, 3 with 4, and so on. An odd x and an even x cannot share an image: x + 1 = x − 1 would give x − x = 2, but an even number minus an odd one is odd. Two odd inputs, or two even ones, give equal images only if they are equal. Every odd m = 2r + 1 is the image of 2r + 2, and every even m = 2r is the image of 2r − 1. So f is bijective.
Counting functions (JEE). Beyond the NCERT text, these counts are reasoned with the counting rules of Class 11. Let n(A) = m and n(B) = n, with m, n positive integers for the formulas below.
- Each of the m elements of A can go to any of the n elements of B, so there are nm functions from A to B.
- For one-one functions the images must all be different, so there are n(n − 1)…(n − m + 1) = n!/(n − m)! of them when m ≤ n, and none when m > n.
- Onto functions are counted by removing those that miss an element of B: 2m − 2 onto a 2-element set, and 3m − 3 × 2m + 3 onto a 3-element set (36 from a 4-element set).
- When m = n, the one-one functions are exactly the bijections, and there are n! of them. NCERT Miscellaneous Example 22 (page 14) counts 3! = 6 for A = {1, 2, 3}.
If A is empty, there is exactly one function from A to any B, the empty function; it is onto only when B is also empty. If A is non-empty and B is empty, no function A → B exists. These cases should be handled separately from the simplified onto formulas.
One-one and onto on a finite set
NCERT Examples 13 and 14 (page 10) show that a function from {1, 2, 3} to itself is one-one if it is onto, and onto if it is one-one. If two of the three elements shared an image, the range would have at most two elements, so f could not be onto. If all three images are different, they use up all of {1, 2, 3}.
The results mentioned in Examples 13 and 14 are also true for an arbitrary finite set X, i.e., a one-one function f : X → X is necessarily onto and an onto map f : X → X is necessarily one-one, for every finite set X.
NCERT Mathematics Part I (Class 12), Section 1.3, page 10
For an infinite set this fails. f(x) = 2x on N is one-one but not onto (Example 8), and NCERT Example 10 on N is onto but not one-one. NCERT calls this “a characteristic difference between a finite and an infinite set” (page 10).
Solved examples
Example 1: Squares and cubes on N, Z and R (NCERT Exercise 1.2, Q2)
Check the injectivity and surjectivity of (i) x2 from N to N; (ii) x2 from Z to Z; (iii) x2 from R to R; (iv) x3 from N to N; (v) x3 from Z to Z.
(i) On N all inputs are positive, so x2 = x2 gives x = x; but 2 is not the square of a natural number. (ii) and (iii) (−1)2 = 12, and −1 is never a square. (iv) and (v) x3 = x3 gives x = x (cubes keep the sign); but 2 is not the cube of an integer.
Answer: (i), (iv) and (v) are injective but not surjective; (ii) and (iii) are neither injective nor surjective.
Example 2: A line and a parabola (NCERT Exercise 1.2, Q7)
State whether each function from R to R is one-one, onto or bijective: (i) f(x) = 3 − 4x; (ii) f(x) = 1 + x2.
(i) 3 − 4x = 3 − 4x gives x = x. For any real y, x = (3 − y)/4 is real and f(x) = 3 − (3 − y) = y.
(ii) f(1) = f(−1) = 2. Also 1 + x2 ≥ 1, so 0 is never an image.
Answer: (i) bijective; (ii) neither one-one nor onto.
Example 3: A rational function (NCERT Exercise 1.2, Q10)
A = R − {3} and B = R − {1}. Is f : A → B, f(x) = (x − 2)/(x − 3), one-one and onto?
One-one: cross-multiplying f(x) = f(x) gives
(x − 2)(x − 3) = (x − 2)(x − 3),
which expands to −3x − 2x = −3x − 2x, so x = x.
Onto: from y = (x − 2)/(x − 3), y(x − 3) = x − 2, so x(y − 1) = 3y − 2 and
x = (3y − 2)/(y − 1),
which is a real number for every y ≠ 1. It is never 3, since (3y − 2)/(y − 1) = 3 would need −2 = −3. So every y in B has a preimage in A.
Answer: yes, f is one-one and onto. (Writing f(x) = 1 + 1/(x − 3) shows at once why the value 1 is missing.)
Example 4: Halving the natural numbers (NCERT Exercise 1.2, Q9)
f : N → N is f(n) = (n + 1)/2 for odd n and n/2 for even n. Is f bijective?
f(1) = (1 + 1)/2 = 1 and f(2) = 2/2 = 1, so f is not one-one. It is onto: any m ∈ N is f(2m).
Answer: no; f is onto but not one-one.
Example 5: Squeezing R into (−1, 1) (NCERT Miscellaneous Exercise, Q1)
Show that f : R → {x ∈ R : −1 < x < 1}, f(x) = x/(1 + |x|), is one-one and onto.
f(x) has the sign of x, so equal images come from inputs of the same sign. For x ≥ 0, f(x) = x/(1 + x), and x/(1 + x) = x/(1 + x) gives x + xx = x + xx, so x = x. For x < 0, f(x) = x/(1 − x), and the same steps give x = x.
Onto: for 0 ≤ y < 1 take x = y/(1 − y) ≥ 0, and for −1 < y < 0 take x = y/(1 + y) < 0. For example y = 1/2 comes from x = 1, and y = −3/4 from x = −3.
Answer: f is one-one and onto, a bijection from R to (−1, 1).
Common mistakes to avoid
Common mistake
Ignoring the codomain
“Is x2 onto?” has no answer until the codomain is known. From R to R it is not, since −1 is missed; from R to [0, ∞) it is.
Common mistake
Mixing up “function” and “one-one”
“Each x has exactly one image” is what makes f a function at all. One-one is the reverse condition: each image comes from exactly one x.
Common mistake
Using the finite-set rule where it does not apply
One-one and onto go together only for a function from a finite set to itself (or to a set of the same size). On N, f(x) = 2x is one-one but not onto.
Common mistake
Solving for x and stopping there
To prove onto, the x found from y must lie in the domain. For 2x on N, y = 3 gives x = 3/2, which is not in N, so 3 is not an image.
Quick revision summary
- One-one (injective): f(x) = f(x) ⇒ x = x; otherwise f is many-one.
- Onto (surjective): every y in the codomain is some f(x), so the range equals the codomain. A function that is not onto is called into.
- Bijective: one-one and onto. For a finite set X, f : X → X is one-one exactly when it is onto.
- Prove one-one from two general inputs; prove onto by solving f(x) = y inside the domain; disprove either with one example.
Formula sheet
- one-one: f(x) = f(x) ⇒ x = x
- onto: range of f = Y; each y ∈ Y equals f(x) for some x ∈ X
- bijective = one-one and onto
- finite X: f : X → X is one-one ⇔ f is onto
- n(A) = m, n(B) = n, m,n > 0: nm functions; n!/(n − m)! one-one (m ≤ n)
Questions students ask
How do the sizes of A and B decide whether f : A → B can be one-one or onto?
For finite sets A and B, a one-one function from A to B exists only when n(A) ≤ n(B), an onto function only when n(A) ≥ n(B), and a bijection only when n(A) = n(B). A one-one function gives the n(A) elements of A different images, so B needs at least that many elements; an onto function must reach every element of B, and n(A) elements have at most n(A) images. For example, from a 3-element set to a 7-element set, 7 × 6 × 5 = 210 of the 73 = 343 functions are one-one and none is onto. When n(A) = n(B), one-one and onto go together, as the finite-set rule shows.
How many onto functions are there from a set with m elements to a set with n elements?
For positive integers m and n, there are no onto functions from a set of m elements to a set of n elements when m < n, and for m ≥ n inclusion–exclusion counts them: start from all nm functions, take away those that miss a chosen element of the codomain, add back those that miss two, and so on. That gives nm − nC1(n − 1)m + nC2(n − 2)m − …, which for a 4-element codomain is 4m − 4 × 3m + 6 × 2m − 4; for m = 7 it is 47 − 4 × 37 + 6 × 27 − 4 = 8400.
Is a one-to-one function the same as a bijection?
No, a one-to-one function need only be one-one (injective), while a bijection, also called a one-to-one correspondence, is both one-one and onto: every bijection is one-to-one, but a one-to-one function is a bijection only if it is also onto. The names pair up: one-one, one-to-one and injective mean the same; onto and surjective mean the same; and a bijective function, a one-one onto function and a bijection are the same thing. For example, f : {1, 2} → {1, 2, 3} with f(1) = 1 and f(2) = 3 is one-to-one but not a one-to-one correspondence, because 2 is never an image. NCERT writes “one-one”, “onto” and “one-one and onto (or bijective)”.
How can the derivative show that a function is one-one?
A real function whose derivative is positive (or negative) throughout an interval is strictly increasing (or decreasing) there, by the first derivative test of NCERT Chapter 6, so it is one-one on that interval. For f(x) = x3 + 5x, f′(x) = 3x2 + 5 > 0 for every x, so f is one-one on R; for g(x) = x3 − 4x, the derivative 3x2 − 4 changes sign and g(−2) = g(0) = g(2) = 0, so g is many-one. The test is sufficient but not necessary: x5 is one-one although its derivative is 0 at x = 0.
Practice questions
Try each question first, then open the answer to check your working.
-
Q1. Prove that the greatest integer function f : R → R, f(x) = [x], is neither one-one nor onto (NCERT Exercise 1.2, Q3).
Show answerHide answer
[1] = [1.5] = 1, so it is not one-one. Its values are integers only, so 0.5 is not an image: not onto.
-
Q2. Show that the modulus function f(x) = |x| and the signum function, both from R to R, are neither one-one nor onto (NCERT Exercise 1.2, Q4 and Q5).
Show answerHide answer
|−1| = |1| = 1, and −1 is never a value of |x|. sgn 1 = sgn 2 = 1, and sgn takes only the values −1, 0 and 1, so 2 is not an image.
NCERT slip (page 11): in NCERT’s PDF of Exercise 1.2, Q5, the minus sign of −1 in the third line uses a character the file’s font does not define, so depending on your PDF viewer it may show as a broken mark or not at all, and the line can seem to read “1, if x < 0”. The signum function is −1 for x < 0, as in NCERT Class 11, Chapter 2. The answer, neither one-one nor onto, is the same either way.
-
Q3. R∗ is the set of non-zero real numbers. Show that f : R∗ → R∗, f(x) = 1/x, is one-one and onto. Is this still true if the domain is N and the codomain stays R∗? (NCERT Exercise 1.2, Q1)
Show answerHide answer
1/x = 1/x gives x = x, and any y ≠ 0 is the image of 1/y ≠ 0: one-one and onto. With domain N it is still one-one, but not onto: y = 2 would need x = 1/2, which is not in N. So the answer is no.
-
Q4. Choose the correct answer for f : R → R: (a) f(x) = x4; (b) f(x) = 3x. (A) one-one onto; (B) many-one onto; (C) one-one but not onto; (D) neither one-one nor onto (NCERT Exercise 1.2, Q11 and Q12).
Show answerHide answer
(a) (−1)4 = 14, and −1 is never a fourth power: (D). (b) 3x = 3x gives x = x, and any y is the image of y/3: (A).