EngineeringRise

Functions: One-One, Onto and Composition for JEE Main

Reviewed Last updated 2026-11-20. Syllabus topic: Functions: one-one, onto and composition.

In short. A function gives every element of the domain exactly one image. It is one-one if different inputs give different outputs and onto if the range equals the codomain; composition (f o g)(x) = f(g(x)) needs the range of g inside the domain of f.

  • Functions from an m-set to an n-set number nᵐ; one-one ones n!/(n - m)!; onto ones come from inclusion-exclusion.
  • One-one is tested by f(a) = f(b) implies a = b, or by strict monotonicity; onto means range equals codomain.
  • The range is found by solving y = f(x) for x and requiring a real solution in the domain.
  • Composition is associative but not commutative; (f o g) one-one forces g one-one, and (f o g) onto forces f onto.
  • A function has an inverse exactly when it is one-one and onto, and (f o g)^(-1) = g^(-1) o f^(-1).

Syllabus line: SETS, RELATIONS AND FUNCTIONS: Sets and their representation; Union, intersection and complement of sets and their algebraic properties; Power set; Relations, type of relations, equivalence relations, functions; one-one, into and onto functions, the composition of functions. (NTA JEE (Main) 2026 syllabus, Mathematics, Unit 1 (https://jeemain.nta.nic.in/document/syllabus-2026/))

Before you start

Prerequisites

  • Relations and equivalence relations: A function is a special relation, and the domain, codomain and range ideas are introduced there. Read this first if those words are unclear.

Related topics

The concept step by step

  1. Step 1: What makes a rule a function

    Every element of the domain must have exactly one image. Check that no input is missing (for example a division by zero) and none has two outputs. Equality of functions needs the same domain, codomain and rule.

  2. Step 2: One-one tests

    To show f is one-one, assume f(a) = f(b) and derive a = b. To show it is not, give two different inputs with the same output. For a real function, a strictly increasing or strictly decreasing function is one-one; a turning point inside the domain destroys it.

  3. Step 3: Onto means range equals codomain

    Find the range by solving y = f(x) for x and keeping the y for which a real x in the domain exists. If the range is smaller than the stated codomain, the function is into. Changing the codomain to the range makes any function onto.

  4. Step 4: Counting functions on finite sets

    All functions: nᵐ. One-one: n(n-1)...(n-m+1). Onto: inclusion-exclusion, nᵐ - C(n,1)(n-1)ᵐ + C(n,2)(n-2)ᵐ - ... Bijections: n!. Start from the all-functions count and subtract what fails.

  5. Step 5: Composition and inverse

    Compute (f o g)(x) by substituting g(x) into f, working from the inside out. The order matters: f o g and g o f differ in general. A bijection has an inverse, found by solving y = f(x) for x; the inverse of a composite reverses the order.

Worked examples

Each solution shows the marks every step would earn. The sanity check tests units and size of the answer.

Example 1 (easy)

Find the number of one-one functions from 1, 2, 3 to 1, 2, 3, 4, 5, 6.

Marks-style solution of example 1
StepMarks
The image of 1 has 6 choices.1
The image of 2 must differ from it: 5 choices; the image of 3: 4 choices.1
The count is 6 x 5 x 4 = 120.1
Total: 3 marks3

Answer: 120

Fast method: Count n(n-1)...(n-m+1) = 6P3.

Sanity check: The count 120 is less than the total 6³ = 216 functions, as one-one functions are a part of all functions.

Example 2 (easy)

Find the minimum value of f(x) = x² - 4x + 7 for real x, and hence its range.

Marks-style solution of example 2
StepMarks
Complete the square: f(x) = (x - 2)² + 3.1
A square is never negative, so f(x) is at least 3, attained at x = 2.1
The range is [3, infinity) and the minimum value is 3.1
Total: 3 marks3

Answer: 3

Fast method: Minimum of a x² + b x + c is c - b²/(4a) = 7 - 16/4 = 3.

Sanity check: At x = 0, f = 7, at x = 2, f = 3 and at x = 4, f = 7, symmetric about the vertex, with 3 the lowest.

Example 3 (medium)

For f(x) = 3x + 1 and g(x) = x² - 2, find the number of real x with f(g(x)) = g(f(x)).

Marks-style solution of example 3
StepMarks
f(g(x)) = 3(x² - 2) + 1 = 3x² - 5.1
g(f(x)) = (3x + 1)² - 2 = 9x² + 6x - 1.1
Equating: 6x² + 6x + 4 = 0, with discriminant 36 - 96 = -60 < 0.1
There are 0 real solutions.1
Total: 4 marks4

Answer: 0

Fast method: Equate the two composites and read the discriminant.

Sanity check: The quadratic 6x² + 6x + 4 has positive leading coefficient and negative discriminant, so it is positive for every x and never zero.

Example 4 (medium)

Let f(x) = x³ - 3x on the reals. Find the number of real x with f(x) = 0 and decide whether f is one-one.

Marks-style solution of example 4
StepMarks
f(x) = x(x² - 3), so f(x) = 0 at x = 0, root 3 and minus root 3.1
Three different inputs give the same output 0.1
So f is not one-one; the number of real zeros is 3.1
Total: 3 marks3

Answer: 3

Fast method: A one-one function takes each value at most once; three zeros settle it.

Sanity check: f is a cubic with positive leading coefficient, so it is onto R, and the turning points at x = 1 and x = -1 (f = -2 and 2) show the rise-fall-rise shape giving three zeros.

Typical trap: Believing every cubic is one-one because x³ is. Adding a linear term can create turning points; test the derivative 3x² - 3, which changes sign.

Example 5 (hard, multi-step)

Find the number of onto functions from 1, 2, 3, 4, 5, 6 to a, b, c.

Marks-style solution of example 5
StepMarks
All functions: 3⁶ = 729.1
Functions missing at least one image, by inclusion-exclusion: 3 x 2⁶ - 3 x 1⁶ = 192 - 3 = 189.2
Onto functions = 729 - 189 = 540.1
The answer is 540.1
Total: 5 marks5

Answer: 540

Fast method: Onto count = 3! x S(6,3) = 6 x 90 = 540.

Sanity check: The count 540 is below 729 and above 0, and the ratio 540/729 is about 0.74, so about three-quarters of all functions are onto, plausible for 6 inputs and 3 outputs.

Example 6 (hard, multi-step)

For f(x) = (x² + x + 1)/(x² - x + 1) on the reals, find the ratio of the maximum to the minimum value.

Marks-style solution of example 6
StepMarks
Put y = f(x): (y - 1) x² - (y + 1) x + (y - 1) = 0.1
For a real x, the discriminant is non-negative: (y + 1)² - 4 (y - 1)² = (3 - y)(3y - 1) at least 0.2
So 1/3 is at most y, which is at most 3; the denominator never vanishes, so the range is [1/3, 3].1
The ratio is 3 / (1/3) = 9.1
Total: 5 marks5

Answer: 9

Fast method: Cross-multiply, impose a non-negative discriminant and read the two end values.

Sanity check: At x = 1, f = 3/1 = 3 and at x = -1, f = 1/3, matching the end values found, and f(0) = 1 lies between them.

Formulas and units

Formula and unit box for Functions: one-one, onto and composition
ResultFormulaValid whenUnits or noteWorked example
All functions, m-set to n-setnᵐm-element domain, n-element codomaindimensionless countExample 5
One-one functionsn(n-1)...(n-m+1) (m at most n)one-one maps, m <= n (else 0)dimensionless countExample 1
Onto functionssum over k of (-1)ᵏ C(n,k) (n-k)ᵐonto maps, m >= n (else 0), k from 0 to ndimensionless countExample 5
Bijectionsn! (m = n)one-one and onto between equal finite setsdimensionless countnone
Minimum of a x² + b x + c (a > 0)c - b²/(4a) at x = -b/(2a)a > 0, x realsame as fnone
Composition(f o g)(x) = f(g(x))g(x) in the domain of fsame as fExample 3
Inverse of a composite(f o g)^(-1) = g^(-1) o f^(-1)f and g bijectivefunctionnone
Composition factsf o g one-one implies g one-one; f o g onto implies f ontonot applicablen/a (statement)none

Use your browser's print command to print this page; the formula box prints on its own page. Download the one-page formula sheet (PDF).

Common mistakes and speed

  • Taking onto functions from m to n as nᵐ or as C(m,n). Why it tempts: The all-functions count nᵐ is quick to write, and the onto count needs the inclusion-exclusion correction.
  • Treating f o g and g o f as equal. Why it tempts: Multiplication is commutative, so the same habit carries over to composition.
  • Calling a cubic with a linear term one-one without checking the derivative. Why it tempts: x³ is one-one and the extra term looks harmless.
  • Deciding onto-ness against the wrong codomain. Why it tempts: The range is computed correctly but compared with R by habit, not with the codomain stated in the question.

Time per question and fast method

Target: about 100 seconds per question.

For counting, write nᵐ, then the permutation count, and subtract for onto. For range, cross-multiply and use the discriminant, or complete the square. For composition, substitute from the inside and keep the two orders apart.

Recall quiz

Pick an option for each question. Your answers stay on this page and are not sent anywhere.

Question 1. The number of one-one functions from 1, 2, 3 to 1, 2, 3, 4 is
Show the answer

Answer: B: 24. Choose images in turn: 4 x 3 x 2 = 24 one-one functions.

Question 2. The number of functions from a set with 5 elements to a set with 2 elements is
Show the answer

Answer: C: 32. Each of the 5 inputs has 2 choices: 2⁵ = 32.

Question 3. If f(x) = x + 2 and g(x) = 2x, then (f o g)(3) equals
Show the answer

Answer: B: 8. g(3) = 6 and f(6) = 8. The other order gives 10.

Question 4. The number of onto functions from a 3-element set to itself is
Show the answer

Answer: A: 6. On a finite set of equal sizes, onto is the same as one-one, so there are 3! = 6.

Question 5. If f o g is onto, then
Show the answer

Answer: B: f must be onto. Every value of f o g is a value of f, so the range of f covers the final codomain.

Question 6. The function f(x) = x² from R to R is
Show the answer

Answer: C: many-one and into. f(2) = f(-2) so it is many-one, and no negative number is a value, so it is into.

Practice

Test your answers nowFull-length mocks

Previous-year questions

Previous-year questions are not imported yet. Previous-year questions are not imported yet; see the official papers on the NTA site. Official NTA papers page.

Going deeper and revision

Definition, domain, codomain, range and equality

A function f from A to B assigns to each element of A exactly one element of B. A is the domain, B is the codomain and the set of values actually taken is the range, a subset of B. Equivalently f is a relation in which no element of A is missing and no element has two images (the vertical line test on a graph). Two functions are equal only if their domains, codomains and rules all agree, so f(x) = x and g(x) = x²/x are different because g is undefined at 0. The number of functions from an m-element set to an n-element set is nᵐ, because each of the m inputs picks one of n outputs independently.

One-one, onto, into, many-one and counting

f is one-one if f(a) = f(b) implies a = b (equivalently distinct inputs give distinct outputs); a continuous real function is one-one on an interval exactly when it is strictly monotonic there, so check the sign of the derivative. f is onto if the range equals the codomain; otherwise it is into. For finite sets, one-one needs m at most n and the count is n(n-1)...(n-m+1); onto needs m at least n and the count is the sum over k of (-1)ᵏ C(n,k) (n-k)ᵐ; a bijection needs m = n and there are n! of them. For m = n, one-one and onto are equivalent. Edge cases: x² on the reals is many-one and into R, but on [0, infinity) to [0, infinity) it is a bijection; a cubic such as x³ - 3x is onto R but not one-one.

Finding the range

To find the range of y = f(x), solve for x in terms of y and require a real x in the domain. For a quadratic a x² + b x + c over the reals the minimum (a > 0) is c - b²/(4a) at x = -b/(2a), and the range is [that value, infinity). For a ratio of quadratics, cross-multiply to get a quadratic in x with coefficients depending on y and impose a non-negative discriminant (also check the leading coefficient being zero separately). For a restricted domain, evaluate at the endpoints and at the vertex only if it lies in the domain. The codomain given in the problem is not the range: always decide onto-ness by comparing the two.

Composition and inverse

The composition (f o g)(x) = f(g(x)) is defined when the range of g lies inside the domain of f. It is associative, (f o g) o h = f o (g o h), but generally not commutative, so f o g and g o f must be computed separately. If f o g is one-one then g is one-one; if f o g is onto then f is onto; the converses fail in general. A function has an inverse exactly when it is a bijection; then f^(-1)(f(x)) = x and the graphs of f and f^(-1) are mirror images about y = x. For composites, (f o g)^(-1) = g^(-1) o f^(-1): the last operation is undone first. To find the inverse write y = f(x), solve for x, and swap roles, giving the domain from the range of f.

Memory hook

Suppose 4 students are each assigned exactly one of 6 bus seats. The first student can take any of 6 seats, the second any of the remaining 5, then 4, then 3.

  1. Suppose no two students may share a seat: the number of ways is 6 x 5 x 4 x 3 = 360.
  2. If sharing were allowed, each student would choose from all 6 seats freely, giving 6⁴ = 1296 assignments.
  3. Every seat being used is impossible with 4 students and 6 seats, which is why there is no onto assignment here, while one-one assignments exist.

Assigning each student a seat is a function; no shared seats is one-one, every seat used is onto.

One-one means no shared seat; onto means no empty seat.

Revision card

Try to answer each without looking above.

  1. How many functions, one-one functions and onto functions are there from an m-set to an n-set?
  2. State the test for a one-one function in algebra and for a real function by derivative.
  3. How is the range of a ratio of quadratics found?
  4. Is composition commutative? Is it associative?
  5. What do f o g one-one and f o g onto imply?
  6. When does f have an inverse, and what is (f o g)^(-1)?

Sources and review

Reviewed Reviewed on 2026-11-20: every number recomputed by code and independently reviewed; textbook section references pending.

  • Method: Every number in worked examples, recall checks and notes recomputed by code; claims recomputed independently by a separate verifier run using other numerical methods; textbook section references not yet attached; wording defects found were fixed afterwards and re-linted (code checks re-run) but not re-reviewed by a second run; syllabus scope compared with the NTA JEE Main 2026 syllabus text (by the verifier; see the report)
  • Reviewer: independent verifier agent run (not the author)
  • Date: 2026-11-20
  • Defects found: 0; fixed: 0
  • Report: content/reviews/learn5-set-2026-11-20.md

Textbook references

  • NCERT Mathematics, Class 11 (reprint 2026-27), Chapter 2: Relations and Functions, 2.3 Functions (read 2026-11-22)
  • NCERT Mathematics Part 1, Class 12 (reprint 2026-27), Chapter 1: Relations and Functions, 1.4 Composition of Functions and Invertible Function (read 2026-11-22)
  • NCERT Mathematics Part 1, Class 12 (reprint 2026-27), Chapter 1: Relations and Functions, 1.3 Types of Functions (read 2026-11-22)

Sources used

  • Syllabus: NTA JEE (Main) 2026 syllabus, Mathematics, Unit 1, line id jee-main-2026-U01 in syllabus/lines/jee-main/2026.json
  • NCERT Class 12 Mathematics, Relations and Functions (read as a reference for scope only; content written fresh for this site, textbook section references still pending)

How labels work: see how answers and lessons are verified. Found a mistake? Use Report an error on any question page.