NIMCET, GATE, CUET & CBSE test series are live — start practicing free
syllabuzAI

One-One, Onto, Bijective and Composite Functions | NIMCET

Learn injective, surjective and bijective functions, how to test them, how to count them, and how composite and inverse functions work, with NIMCET-style examples.

5 min read

SP

SHIVAM PRADHAN

Updated 25 October 2026

On this page

Quick answer: A function f:A→Bf : A \to B is one-one (injective) if different inputs give different outputs, onto (surjective) if every element of B is an output, and bijective if it is both. Only bijective functions have an inverse. The composite (g∘f)(x)=g(f(x))(g \circ f)(x) = g(f(x)) applies f first, then g, and in general g∘f≠f∘gg \circ f \ne f \circ g.

This continues from functions, domain, codomain and range.

Definitions and tests

TypeDefinitionQuick test
One-onef(x1)=f(x2)⇒x1=x2f(x_1) = f(x_2) \Rightarrow x_1 = x_2Horizontal line meets the graph at most once
Many-oneTwo inputs share an outputSome horizontal line meets the graph twice
OntoRange = codomainEvery y in B has a solution x
IntoRange ⊂ codomain, range ≠ codomainSome y has no pre-image
BijectiveOne-one and ontoBoth tests pass

A function that keeps increasing (or keeps decreasing) over its whole domain, with no flat stretch, is one-one; checking the sign of the derivative is a fast test.

Standard examples

FunctionOne-oneOnto
f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=2x+3f(x) = 2x + 3YesYes
f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=x2f(x) = x^2NoNo
f:[0,∞)→[0,∞)f : [0, \infty) \to [0, \infty), f(x)=x2f(x) = x^2YesYes
f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=x3f(x) = x^3YesYes
f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=exf(x) = e^xYesNo
f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=sin⁡xf(x) = \sin xNoNo

The same rule can change type when the domain or codomain changes, as x2x^2 shows.

Counting functions

For n(A)=mn(A) = m and n(B)=nn(B) = n:

TypeNumber
All functionsnmn^m
One-one (m≤nm \le n)n!(n−m)!\frac{n!}{(n - m)!}
Bijections (m=nm = n)n!n!
Onto (m≥nm \ge n)∑r=0n(−1)r(nr)(n−r)m\sum_{r=0}^{n}(-1)^r\binom{n}{r}(n - r)^m

Example: onto functions from a 4-element set to a 2-element set: 24−2=142^4 - 2 = 14 (all functions minus the 2 constant ones).

Composite functions

(g∘f)(x)=g(f(x))(g \circ f)(x) = g(f(x))

This is defined when the range of f lies inside the domain of g.

PropertyStatement
Not commutativeg∘f≠f∘gg \circ f \ne f \circ g in general
Associativeh∘(g∘f)=(h∘g)∘fh \circ (g \circ f) = (h \circ g) \circ f
One-oneIf f and g are one-one, so is g∘fg \circ f
OntoIf f and g are onto, so is g∘fg \circ f

Example: f(x)=x+1f(x) = x + 1 and g(x)=x2g(x) = x^2. Then (g∘f)(x)=(x+1)2(g \circ f)(x) = (x + 1)^2 and (f∘g)(x)=x2+1(f \circ g)(x) = x^2 + 1, which are different.

Inverse functions

If f:A→Bf : A \to B is a bijection, its inverse f−1:B→Af^{-1} : B \to A satisfies f−1(y)=x  ⟺  f(x)=yf^{-1}(y) = x \iff f(x) = y.

Method: write y=f(x)y = f(x), solve for x, then swap the letters.

Example: f(x)=2x+35f(x) = \frac{2x + 3}{5}.

Step 1: 5y=2x+35y = 2x + 3, so x=5y−32x = \frac{5y - 3}{2}.

Step 2: f−1(x)=5x−32f^{-1}(x) = \frac{5x - 3}{2}.

Key facts:

  • f−1(f(x))=xf^{-1}(f(x)) = x and f(f−1(y))=yf(f^{-1}(y)) = y.
  • (g∘f)−1=f−1∘g−1(g \circ f)^{-1} = f^{-1} \circ g^{-1}.
  • The graph of f−1f^{-1} is the reflection of the graph of f in the line y=xy = x.

Worked examples

Example 1: testing one-one

Is f(x)=x2−4xf(x) = x^2 - 4x one-one on ℝ? No: f(0)=f(4)=0f(0) = f(4) = 0.

Example 2: testing onto

Is f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=3x−7f(x) = 3x - 7 onto? For any y, x=y+73x = \frac{y + 7}{3} is real, so yes.

Example 3: counting one-one functions

How many one-one functions are there from {1,2,3}\{1, 2, 3\} to {a,b,c,d}\{a, b, c, d\}?

4!1!=24\frac{4!}{1!} = 24.

Example 4: composite value

If f(x)=2xf(x) = 2x and g(x)=x2+1g(x) = x^2 + 1, find (f∘g)(2)(f \circ g)(2).

g(2)=5g(2) = 5, then f(5)=10f(5) = 10.

Summary table

ConceptKey result
One-oneDistinct inputs give distinct outputs
OntoRange equals codomain
BijectionHas an inverse
One-one countn!(n−m)!\frac{n!}{(n - m)!}
(g∘f)−1(g \circ f)^{-1}f−1∘g−1f^{-1} \circ g^{-1}

Exam tips

  • Always check the stated domain and codomain before deciding onto or one-one.
  • For onto questions, try to solve f(x)=yf(x) = y for a general y.
  • For two-element codomains, onto count =2m−2= 2^m - 2.
  • Read the order of composition carefully: g∘fg \circ f means f first.

Continue with mathematical logic and truth tables, or see the NIMCET Set Theory chapter.

Common mistakes

  • Deciding onto without looking at the codomain.
  • Writing (g∘f)−1=g−1∘f−1(g \circ f)^{-1} = g^{-1} \circ f^{-1}; the order reverses.
  • Assuming every one-one function is onto.
  • Confusing f−1(x)f^{-1}(x) with 1f(x)\frac{1}{f(x)}.

Frequently Asked Questions

What is a one-one function?

A function is one-one if different inputs always give different outputs, that is, f(x₁) = f(x₂) implies x₁ = x₂.

What is an onto function?

A function f : A → B is onto if every element of B is the image of at least one element of A.

How many bijections are there between two sets of n elements?

There are n! bijections.

When does a function have an inverse?

A function has an inverse only when it is bijective (one-one and onto).

Is fog equal to gof?

Not in general. Composition of functions is not commutative.

Concept Check

MEDIUM

If Z∼N(0,1)Z \sim \mathcal{N}(0, 1), what is the distribution of W=Z2W = Z^2?

Suggested for you