Check if f(x) = x² is one-one and onto from R to R

medium CBSE JEE-MAIN 4 min read

Question

Check whether the function f:RRf: \mathbb{R} \rightarrow \mathbb{R} defined by f(x)=x2f(x) = x^2 is (a) one-one (injective) and (b) onto (surjective).


Solution — Step by Step

One-one (Injective): A function ff is one-one if distinct inputs give distinct outputs. Formally: f(a)=f(b)    a=bf(a) = f(b) \implies a = b for all a,ba, b \in domain.

Equivalently: if aba \neq b, then f(a)f(b)f(a) \neq f(b).

Onto (Surjective): A function f:ABf: A \rightarrow B is onto if every element of the codomain BB is the image of at least one element from AA. Formally: For every yBy \in B, there exists xAx \in A such that f(x)=yf(x) = y.

Take f(a)=f(b)f(a) = f(b):

a2=b2    a2b2=0    (ab)(a+b)=0a^2 = b^2 \implies a^2 - b^2 = 0 \implies (a-b)(a+b) = 0

So either a=ba = b OR a=ba = -b.

Since a=ba = -b is possible (e.g., a=2,b=2a = 2, b = -2), we can have f(a)=f(b)f(a) = f(b) with aba \neq b.

Counterexample: f(2)=4f(2) = 4 and f(2)=4f(-2) = 4. So two different inputs (2 and -2) give the same output (4).

Conclusion: f(x)=x2f(x) = x^2 is NOT one-one (not injective).

We need to check if every real number yRy \in \mathbb{R} can be written as y=x2y = x^2 for some real xx.

Consider y=1y = -1 (a negative real number). Is there any xRx \in \mathbb{R} such that x2=1x^2 = -1?

x2=1x^2 = -1

There is no real solution — the square of any real number is non-negative. So x20x^2 \geq 0 for all xRx \in \mathbb{R}.

This means no negative number is in the range of ff. The range of ff is [0,)[0, \infty), but the codomain is R\mathbb{R} (which includes negative numbers).

Since range \subsetneq codomain, the function is NOT onto.

Conclusion: f(x)=x2f(x) = x^2 is NOT onto (not surjective) as a function from R\mathbb{R} to R\mathbb{R}.

f:RRf: \mathbb{R} \rightarrow \mathbb{R}, f(x)=x2f(x) = x^2:

  • NOT one-one: Because f(2)=f(2)=4f(2) = f(-2) = 4 (two distinct inputs map to the same output)
  • NOT onto: Because negative real numbers (like 1-1) have no pre-image in R\mathbb{R} under ff

Therefore, f(x)=x2f(x) = x^2 is neither injective nor surjective as a function from R\mathbb{R} to R\mathbb{R}.


Why This Works

The issue with injectivity: x2x^2 is an even function — f(x)=f(x)f(-x) = f(x). Any even function that maps both positive and negative values in the domain will fail the one-one test because symmetric inputs give the same output.

The issue with surjectivity: the codomain is R\mathbb{R} (all real numbers), but the function only produces non-negative values. The range is [0,)R[0, \infty) \subsetneq \mathbb{R}. A function is onto only when range = codomain.

Key insight: The same function with a DIFFERENT codomain can be onto. If we define f:R[0,)f: \mathbb{R} \rightarrow [0, \infty), then f(x)=x2f(x) = x^2 IS onto (every non-negative number is a square of some real number).

Similarly, f:[0,)[0,)f: [0, \infty) \rightarrow [0, \infty), f(x)=x2f(x) = x^2 is both one-one AND onto — it becomes a bijection.


Alternative Method — Graph Analysis

The horizontal line test:

  • One-one test: If any horizontal line y=cy = c crosses the graph more than once → not one-one.

  • The graph of y=x2y = x^2 (parabola) has a horizontal line at y=4y = 4 crossing at x=2x = 2 and x=2x = -2 → not one-one. ✓

  • Onto test: If there exists a horizontal line y=cy = c (for cc \in codomain) that doesn’t cross the graph → not onto.

  • For y=1y = -1, the horizontal line y=1y = -1 is entirely below the parabola — no intersection → not onto. ✓

CBSE Class 12 and JEE Main both test this “check injectivity/surjectivity” question type. Always: (1) find a counterexample for “not one-one,” (2) find a value of yy with no xx-preimage for “not onto.” A concrete counterexample with specific numbers always earns full marks.


Common Mistake

Students sometimes say ”f(x)=x2f(x) = x^2 is one-one because f(2)f(3)f(2) \neq f(3)” — showing that two specific values give different outputs doesn’t prove one-one. One-one requires ALL pairs of distinct inputs to give distinct outputs. You only need ONE counterexample (like f(2)=f(2)=4f(2) = f(-2) = 4) to disprove it. For proofs, find the counterexample; don’t just verify specific cases.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next