Types of Functions

The two questions that classify every function

From Class XI you know functions and their graphs — identity, constant, polynomial, rational, modulus, signum, greatest integer. This section asks two sharper questions about any function f:X→Yf : X \to Y:

Question 1 — do distinct inputs stay distinct? (Is ff one-one?)

Question 2 — does every element of YY get hit? (Is ff onto?)

Four mapping diagrams: one-one not onto, many-one, onto not one-one, bijective

Definition (one-one / injective). f:X→Yf : X \to Y is one-one if the images of distinct elements are distinct — equivalently, for every x1,x2∈Xx_1, x_2 \in X, f(x1)=f(x2)  ⟹  x1=x2f(x_1) = f(x_2) \implies x_1 = x_2 A function that is not one-one is called many-one.

Definition (onto / surjective). f:X→Yf : X \to Y is onto if every y∈Yy \in Y is the image of some x∈Xx \in X: for every y∈Yy \in Y there exists x∈Xx \in X with f(x)=yf(x) = y. Equivalently: Range of ff = YY (the whole co-domain).

Definition (bijective). ff is bijective if it is both one-one and onto — a perfect pairing between XX and YY.

The proof templates (used in every board answer)

To prove one-one: start from f(x1)=f(x2)f(x_1) = f(x_2) and derive x1=x2x_1 = x_2 by algebra. f(x)=2x:f(x1)=f(x2)⇒2x1=2x2⇒x1=x2f(x) = 2x: \quad f(x_1) = f(x_2) \Rightarrow 2x_1 = 2x_2 \Rightarrow x_1 = x_2

To disprove one-one: exhibit two distinct inputs with the same image. f(x)=x2 on R:f(−1)=1=f(1), and −1≠1f(x) = x^2 \text{ on } \mathbb{R}: \quad f(-1) = 1 = f(1), \text{ and } -1 \neq 1

To prove onto: take an arbitrary yy in the co-domain and solve f(x)=yf(x) = y for xx, checking the solution lies in the domain. f(x)=2x on R:given y, take x=y2∈R, f(y2)=yf(x) = 2x \text{ on } \mathbb{R}: \quad \text{given } y, \text{ take } x = \frac{y}{2} \in \mathbb{R}, \ f\left(\frac{y}{2}\right) = y

To disprove onto: exhibit one element of the co-domain with no preimage. f(x)=2x on N:1∈N but 2x=1 has no solution in Nf(x) = 2x \text{ on } \mathbb{N}: \quad 1 \in \mathbb{N} \text{ but } 2x = 1 \text{ has no solution in } \mathbb{N}

Notice how the same formula f(x)=2xf(x) = 2x is bijective on R\mathbb{R} but only one-one on N\mathbb{N} — the domain and co-domain are part of the function. Changing them changes the classification; this is the single most tested subtlety of the section.

The standard gallery (memorise these verdicts)

Function Domain →\to Co-domain One-one? Onto? Why
2x2x N→N\mathbb{N} \to \mathbb{N} yes no 1 has no preimage
2x2x R→R\mathbb{R} \to \mathbb{R} yes yes solve y=2xy = 2x
x2x^2 N→N\mathbb{N} \to \mathbb{N} yes no 2 is not a square
x2x^2 Z→Z\mathbb{Z} \to \mathbb{Z} or R→R\mathbb{R} \to \mathbb{R} no no f(±1)=1f(\pm 1) = 1; negatives unhit
x3x^3 N→N\mathbb{N} \to \mathbb{N} or Z→Z\mathbb{Z} \to \mathbb{Z} yes no cubes are sparse
[x][x] (greatest integer) R→R\mathbb{R} \to \mathbb{R} no no [1.2]=[1.9]=1[1.2] = [1.9] = 1; 12\frac{1}{2} unhit
∣x∣\vert x \vert R→R\mathbb{R} \to \mathbb{R} no no ∣−1∣=∣1∣\vert -1 \vert = \vert 1 \vert; negatives unhit
signum R→R\mathbb{R} \to \mathbb{R} no no range is only {−1,0,1}\{-1, 0, 1\}
3−4x3 - 4x R→R\mathbb{R} \to \mathbb{R} yes yes linear, nonzero slope
1+x21 + x^2 R→R\mathbb{R} \to \mathbb{R} no no f(±1)=2f(\pm 1) = 2; 00 unhit

The Finite-Set Phenomenon and Sharper Examples

One-one   ⟺  \iff onto on a finite set

For maps of a finite set to itself the two properties collapse into one:

Fact. For a finite set XX, a function f:X→Xf : X \to X is one-one if and only if it is onto.

Why (for X={1,2,3}X = \{1,2,3\}): if ff is one-one, its three images are distinct elements of a three-element set — so they fill it, and ff is onto. Conversely if ff is onto but not one-one, two inputs share an image, leaving at most two distinct images to cover three elements — impossible.

This is a characteristic difference between finite and infinite sets: on N\mathbb{N}, the map f(x)=2xf(x) = 2x is one-one but not onto, and the map f(1)=f(2)=1f(1) = f(2) = 1, f(x)=x−1f(x) = x - 1 for x>2x > 2 is onto but not one-one. Neither behaviour can occur on a finite set mapping to itself.

Two functions worth studying closely

The parity swap. f:N→Nf : \mathbb{N} \to \mathbb{N} defined by f(x)={x+1,if x is oddx−1,if x is evenf(x) = \begin{cases} x + 1, & \text{if } x \text{ is odd} \\ x - 1, & \text{if } x \text{ is even} \end{cases} is bijective: it pairs 1↔21 \leftrightarrow 2, 3↔43 \leftrightarrow 4, 5↔6,…5 \leftrightarrow 6, \ldots Each number is both the image of exactly one number and the preimage of exactly one — a perfect shuffle of N\mathbb{N}.

The floor-halving map. f:N→Nf : \mathbb{N} \to \mathbb{N} with f(n)=n+12f(n) = \frac{n+1}{2} for odd nn and n2\frac{n}{2} for even nn sends 1↦1,2↦1,3↦2,4↦2,…1 \mapsto 1, 2 \mapsto 1, 3 \mapsto 2, 4 \mapsto 2, \ldots It is onto (every mm is f(2m)f(2m)) but not one-one (f(1)=f(2)=1f(1) = f(2) = 1) — each output is hit exactly twice.

The rational-function workhorse

f:R−{3}→R−{1}f : \mathbb{R} - \{3\} \to \mathbb{R} - \{1\},  f(x)=x−2x−3\ f(x) = \dfrac{x - 2}{x - 3} is one-one and onto:

One-one: x1−2x1−3=x2−2x2−3\dfrac{x_1 - 2}{x_1 - 3} = \dfrac{x_2 - 2}{x_2 - 3}; cross-multiplying, (x1−2)(x2−3)=(x2−2)(x1−3)(x_1 - 2)(x_2 - 3) = (x_2 - 2)(x_1 - 3), which expands to −3x1−2x2=−3x2−2x1-3x_1 - 2x_2 = -3x_2 - 2x_1, i.e. x1=x2x_1 = x_2.

Onto: given y≠1y \neq 1, solve y=x−2x−3y = \dfrac{x - 2}{x - 3}:  yx−3y=x−2\ yx - 3y = x - 2, so x(y−1)=3y−2x(y - 1) = 3y - 2 and x=3y−2y−1x = \dfrac{3y - 2}{y - 1}, which is defined (since y≠1y \neq 1) and never equals 3 (that would need 3y−2=3y−33y - 2 = 3y - 3, impossible). So every target is hit.

The carefully punctured domain and co-domain are what make this work — another reminder that they are part of the function's identity.

Common mistakes to avoid

Mistake 1 — proving one-one by example. Checking f(1)≠f(2)f(1) \neq f(2) proves nothing; the algebra must run for arbitrary x1,x2x_1, x_2. Conversely a single collision disproves it.

Mistake 2 — confusing range with co-domain. Onto means range = co-domain. The function x2:R→Rx^2 : \mathbb{R} \to \mathbb{R} has range [0,∞)≠R[0, \infty) \neq \mathbb{R}, so it is not onto — even though its range is a perfectly nice set.

Mistake 3 — ignoring the domain when solving f(x)=yf(x) = y. For f(x)=2xf(x) = 2x on N\mathbb{N}, the equation 2x=12x = 1 has the solution x=12x = \frac{1}{2} — but 12∉N\frac{1}{2} \notin \mathbb{N}, so 1 is not hit. The solution must live in the stated domain.

Mistake 4 — 'increasing means onto'. f(x)=x3f(x) = x^3 is strictly increasing on Z\mathbb{Z}, hence one-one, but not onto Z\mathbb{Z}: the value 2 is no integer's cube. Monotonicity gives injectivity, never surjectivity.

Solved Examples

Example 1 — Roll numbers

Let AA be the set of all 50 students of Class X in a school and f:A→Nf : A \to \mathbb{N} assign to each student their roll number. Show that ff is one-one but not onto.

Step 1 — one-one: no two different students share a roll number, so distinct students have distinct images.

Step 2 — not onto: with roll numbers running 1 to 50, the number 51∈N51 \in \mathbb{N} is nobody's roll number — an element of the co-domain with no preimage.

Answer: one-one but not onto. Any injective map of a 50-element set into the infinite set N\mathbb{N} must leave almost everything unhit.

Example 2 — Doubling on N\mathbb{N}

Show that f:N→Nf : \mathbb{N} \to \mathbb{N}, f(x)=2xf(x) = 2x, is one-one but not onto.

Step 1 — one-one: f(x1)=f(x2)⇒2x1=2x2⇒x1=x2f(x_1) = f(x_2) \Rightarrow 2x_1 = 2x_2 \Rightarrow x_1 = x_2.

Step 2 — not onto: for 1∈N1 \in \mathbb{N}, the equation 2x=12x = 1 demands x=12x = \frac{1}{2}, which is not a natural number.

Answer: one-one, not onto — the image is only the even numbers.

Example 3 — Doubling on R\mathbb{R}

Prove that f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=2xf(x) = 2x, is one-one and onto.

Step 1 — one-one: 2x1=2x2⇒x1=x22x_1 = 2x_2 \Rightarrow x_1 = x_2.

Step 2 — onto: given any y∈Ry \in \mathbb{R}, the real number y2\frac{y}{2} satisfies f(y2)=2⋅y2=yf\left(\frac{y}{2}\right) = 2 \cdot \frac{y}{2} = y.

Answer: bijective. Same formula as Example 2, different domain and co-domain, different verdict — the classification belongs to the whole package (f,X,Y)(f, X, Y), not to the formula alone.

Example 4 — Onto but not one-one

Show that f:N→Nf : \mathbb{N} \to \mathbb{N}, given by f(1)=f(2)=1f(1) = f(2) = 1 and f(x)=x−1f(x) = x - 1 for every x>2x > 2, is onto but not one-one.

Step 1 — not one-one: f(1)=f(2)=1f(1) = f(2) = 1 with 1≠21 \neq 2.

Step 2 — onto: given y∈Ny \in \mathbb{N} with y≠1y \neq 1, choose x=y+1>2x = y + 1 > 2; then f(y+1)=yf(y + 1) = y. And 1=f(1)1 = f(1) is also hit.

Answer: onto but not one-one — the map shifts everything down by one and dumps both 1 and 2 onto 1.

Example 5 — The parabola fails both tests

Show that f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=x2f(x) = x^2, is neither one-one nor onto.

Step 1 — not one-one: f(−1)=1=f(1)f(-1) = 1 = f(1).

Step 2 — not onto: −2-2 in the co-domain is no real number's square, since squares are nonnegative.

Answer: neither. (On N→N\mathbb{N} \to \mathbb{N} the same formula is one-one — there are no negatives to collide — but still not onto, since 2 is not a perfect square.)

Example 6 — The parity swap is a bijection

Show that f:N→Nf : \mathbb{N} \to \mathbb{N} given by f(x)=x+1f(x) = x + 1 if xx is odd and f(x)=x−1f(x) = x - 1 if xx is even, is both one-one and onto.

Step 1 — collisions across parities are impossible: if x1x_1 odd and x2x_2 even had f(x1)=f(x2)f(x_1) = f(x_2), then x1+1=x2−1x_1 + 1 = x_2 - 1, i.e. x2−x1=2x_2 - x_1 = 2 — but then x1x_1 and x2x_2 would have the same parity, a contradiction.

Step 2 — collisions within a parity force equality: both odd gives x1+1=x2+1⇒x1=x2x_1 + 1 = x_2 + 1 \Rightarrow x_1 = x_2; both even similarly. So ff is one-one.

Step 3 — onto: any odd number 2r+12r + 1 is the image of the even number 2r+22r + 2, and any even number 2r2r is the image of the odd number 2r−12r - 1.

Answer: bijective — ff swaps each odd number with its even successor.

Example 7 — The finite-set collapse

Show that an onto function f:{1,2,3}→{1,2,3}f : \{1, 2, 3\} \to \{1, 2, 3\} is always one-one, and that a one-one function f:{1,2,3}→{1,2,3}f : \{1, 2, 3\} \to \{1, 2, 3\} must be onto.

Step 1 — onto ⇒\Rightarrow one-one (by contradiction): if ff were not one-one, two elements would share an image, so the range would contain at most two of the three co-domain elements — contradicting onto.

Step 2 — one-one ⇒\Rightarrow onto: three distinct images inside a three-element co-domain must exhaust it.

Answer: on a finite set mapping to itself, one-one and onto are equivalent — and this equivalence fails on infinite sets (Examples 2 and 4 are the counterexamples).