Relations and Functions, Made Simple

A friendly, from-scratch tour of relations (reflexive, symmetric, transitive, equivalence) and functions (one-one, onto, bijective), plus how to compose functions and find inverses — with fully worked examples for CBSE Class 12.

By the PadhoDost Team · 📖 8 min read · Updated 4 August 2026

Part of Class 12 (CBSE) prep

🧠 Your class is a relation

Think of everyone in your school and the rule 'studies in the same class as'. You study in the same class as yourself (obvious, na?). If Aarav is Meera's classmate, then Meera is automatically Aarav's classmate. And if Aarav shares a class with Meera, and Meera with Rohan, then Aarav shares it with Rohan too. That one friendly rule quietly obeys three properties — reflexive, symmetric and transitive — which together make it an 'equivalence relation'. This entire chapter is really about spotting rules like this. Padho, dost — it is more familiar than it looks!

First things first: what is a relation?

A relation R from a set A to a set B is simply a collection of ordered pairs (a, b) — a subset of A × B — that links certain elements of A to certain elements of B. When A and B are the same set, we call it a relation ON A. For example, on the set of your classmates, 'sits on the same bench as' is a relation: for any two people it either holds or it does not. A function, which we meet later, is just a very well-behaved special kind of relation.

Reflexive, symmetric, transitive — and equivalence

The three tests every equivalence relation must pass

  • Reflexive: every element is related to itself — (a, a) ∈ R for every a in A.
  • Symmetric: if (a, b) ∈ R then (b, a) ∈ R — the relation works both ways.
  • Transitive: if (a, b) ∈ R and (b, c) ∈ R, then (a, c) ∈ R — it 'passes through'.
  • Equivalence relation: a relation that is reflexive AND symmetric AND transitive — all three together, not just one or two.

📝 Is 'the difference |a − b| is even' an equivalence relation on {1, 2, 3, 4, 5}?

Let A = {1, 2, 3, 4, 5} and R = {(a, b) : |a − b| is even}.

Reflexive? |a − a| = 0, and 0 is even, so (a, a) ∈ R for every a. Passes.

Symmetric? |a − b| = |b − a|, so if |a − b| is even then |b − a| is even too. Hence (a, b) ∈ R gives (b, a) ∈ R. Passes.

Transitive? Suppose |a − b| and |b − c| are both even. Then (a − b) + (b − c) = a − c is even + even = even, so |a − c| is even. Passes.

All three hold, so R is an equivalence relation.

It splits A into equivalence classes: {1, 3, 5} (the odd numbers) and {2, 4} (the even numbers).

⚠️ Common slip: 'onto' depends on the codomain you are given. f(x) = x² from R to R is NOT onto (negative numbers are never outputs), but the exact same rule from R to [0, ∞) IS onto. Always check what the codomain is before you decide.

Types of functions: one-one, onto, bijective

A function f : A → B assigns to every input in A exactly one output in B. We then classify it by how the outputs behave. If different inputs always give different outputs, it is one-one (injective). If every element of the codomain B is actually reached as an output, it is onto (surjective). A function that is BOTH one-one and onto is called bijective — a perfect one-to-one pairing between A and B. Bijective functions are special because they are exactly the ones we can reverse.

Type of functionThe testIn plain words
One-one (injective)f(x₁) = f(x₂) ⟹ x₁ = x₂Different inputs never share an output
Onto (surjective)Range = CodomainEvery element of the codomain is hit
BijectiveOne-one AND ontoPerfect pairing — this is exactly when f is invertible

Composition of functions

(g ∘ f)(x) = g(f(x)), where f : A → B and g : B → C give g ∘ f : A → C. Feed x into f first, then feed that result into g.

📝 Composing f(x) = 2x + 3 and g(x) = x² (like two machines in a row)

(g ∘ f)(x) = g(f(x)) = g(2x + 3) = (2x + 3)².

(f ∘ g)(x) = f(g(x)) = f(x²) = 2x² + 3.

Check at x = 1: (g ∘ f)(1) = (2·1 + 3)² = 5² = 25.

But (f ∘ g)(1) = 2·1² + 3 = 2 + 3 = 5.

Since 25 ≠ 5, we get g ∘ f ≠ f ∘ g — order matters! Composition is not commutative.

Invertible functions

A function can be reversed only if nothing gets lost and nothing gets missed. 'Nothing gets lost' means no two inputs collapse to the same output (one-one). 'Nothing gets missed' means every element of the codomain is reached (onto). So a function is invertible exactly when it is bijective. To actually find the inverse: write y = f(x), solve for x in terms of y, and then rename the variable back to x.

f is invertible ⟺ f is bijective. Its inverse f⁻¹ then satisfies f⁻¹ ∘ f = I_A and f ∘ f⁻¹ = I_B, where I is the identity function I(x) = x.

📝 Finding the inverse of f(x) = 2x + 3, f : R → R

Step 1 — Put y = f(x): y = 2x + 3.

Step 2 — Solve for x: y − 3 = 2x, so x = (y − 3)/2.

Step 3 — Write the inverse: f⁻¹(x) = (x − 3)/2.

Check: f(f⁻¹(x)) = 2·((x − 3)/2) + 3 = (x − 3) + 3 = x. Correct.

Check: f⁻¹(f(x)) = ((2x + 3) − 3)/2 = 2x/2 = x. Correct.

Both compositions give the identity, so the inverse is right.

⚡ Quick check

For the function f : R → R given by f(x) = 2x + 3, which statement is true?

Ready to test yourself? 🎯

Lock it in with the practice test for this chapter.

Take the practice test →

Keep studying

See all Class 12 (CBSE) study material →