Class 12 Maths, Worked in Full Past papersGet updates
Chapter 1 · Relations and Functions

Example 11: f(x)=x2f(x)=x^2 on R\R⁠: neither

ExamplesTypes of functions · Section 1.3
The question

Show that the function f:R→Rf : \R \to \R⁠, defined as f(x)=x2f(x) = x^2⁠, is neither one-one nor onto.

Exam answer

Not one-one: f(−1)=(−1)2=1f(-1) = (-1)^2 = 1 and f(1)=12=1f(1) = 1^2 = 1⁠, so f(−1)=f(1)f(-1) = f(1) but −1≠1-1 \ne 1⁠. Thus ff is not one-one.

Not onto: x2≥0x^2 \ge 0 for every x∈Rx \in \R⁠, so x2=−2x^2 = -2 has no real solution. So −2∈R-2 \in \R has no pre-image. Thus ff is not onto.

Hence ff is neither one-one nor onto.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Squaring forgets the sign: xx and −x-x always have the same square. That makes ff fail one-one. Squaring also never produces a negative number, since x2≥0x^2 \ge 0 for every real xx⁠. So the whole negative half of the codomain R\R is never reached, and ff fails onto. Both failures are shown with a single explicit counterexample each, as the book does: f(−1)=f(1)f(-1) = f(1)⁠, and −2-2 has no preimage.

Given, to show, and the plan
Given
f(x)=x2f(x) = x^2⁠, with domain R\R and codomain R\R⁠.
To show
(a) ff is not one-one. (b) ff is not onto.
Plan
(1) Disprove one-one with the pair −1,1-1, 1⁠. (2) Disprove onto with the element −2-2⁠, and answer the book's "(Why?)" by proving x2≥0x^2 \ge 0 for every real xx⁠. (3) Identify the range exactly, and conclude.

Basics you need

1One-one and onto

One-one: f(x1)=f(x2)⇒x1=x2f(x_1) = f(x_2) \Rightarrow x_1 = x_2⁠. Onto: every yy in the codomain equals f(x)f(x) for some xx in the domain. Basics: one-one and onto

2Disproving with a counterexample

Both definitions are "for every" statements, so each is disproved by one explicit failure: one pair of distinct inputs with equal images, or one element of the codomain with no preimage. Basics: proving and disproving

3Signs of products

The product of two positive numbers is positive, and the product of two negative numbers is also positive. Zero times anything is zero. Hence a square is never negative. Basics: integers, even and odd

4Neither … nor

"Neither one-one nor onto" is two separate claims, and both must be shown. Showing only one of them is half an answer. Basics: what a function is

Solution

  1. Not one-one: −1-1 and 11 have the same square

    Compute both images:

    f(−1)=(−1)2=1,f(1)=12=1.f(-1) = (-1)^2 = 1, \qquad f(1) = 1^2 = 1.

    So f(−1)=f(1)f(-1) = f(1)⁠, although −1≠1-1 \ne 1⁠. Two different inputs have the same image, so ff is not one-one.

    One-one says every pair with equal images consists of equal inputs. The pair −1,1-1, 1 breaks this, and one such pair is a complete disproof. The choice of ±1\pm 1 is not special: for every a≠0a \ne 0⁠, f(−a)=a2=f(a)f(-a) = a^2 = f(a) with −a≠a-a \ne a⁠, so every positive output is in fact hit twice.
    (−a)2=(−a)(−a)=a2(-a)^2 = (-a)(-a) = a^2⁠: a negative times a negative is positive. That identity is the reason squaring cannot be one-one on a set containing both aa and −a-a⁠.
  2. Why a square is never negative

    Take any real xx⁠. There are three cases.

    • If x>0x > 0⁠: x2=x⋅xx^2 = x \cdot x is a product of two positive numbers, so x2>0x^2 > 0⁠.
    • If x=0x = 0⁠: x2=0x^2 = 0⁠.
    • If x<0x < 0⁠: x2=x⋅xx^2 = x \cdot x is a product of two negative numbers, so x2>0x^2 > 0⁠.

    Every real number falls in exactly one case, so

    x2≥0for every x∈R.x^2 \ge 0 \quad \text{for every } x \in \R.
    This is the answer to the book's "(Why?)" in the next step. It is a "for every xx" statement, so we prove it for an arbitrary xx⁠, splitting into cases that cover all real numbers.
    Proof by cases: the three cases x>0x > 0⁠, x=0x = 0⁠, x<0x < 0 cover every real number, so proving the claim in each covers them all.
  3. Not onto: −2-2 is never a square

    The codomain is R\R⁠, so −2-2 is an element of it. Suppose some real xx had f(x)=−2f(x) = -2⁠, that is x2=−2x^2 = -2⁠. By Step 2, x2≥0x^2 \ge 0⁠, while −2<0-2 < 0⁠. A number cannot be both ≥0\ge 0 and <0< 0⁠, so there is no such xx⁠. Hence −2-2 is not the image of any element of the domain, and ff is not onto.

    −22246(−1, 1)(1, 1)y = 1−11y = −2: no point of the curveshaded: y < 0, never reachedy = x²
    The graph of y=x2y = x^2 (compare the book's Fig 1.4). The line y=1y = 1 meets it twice, at x=−1x = -1 and x=1x = 1⁠: not one-one. The line y=−2y = -2⁠, and every line in the shaded region y<0y < 0⁠, misses it completely: not onto.
    To show an element has no preimage, failing to find one is not enough; we must show that none can exist. Assuming a preimage exists and reaching a contradiction (a number that is both ≥0\ge 0 and negative) does exactly that.
    On a graph, y0y_0 has a preimage exactly when the horizontal line y=y0y = y_0 meets the graph. Two meeting points mean "not one-one"; none means "not onto". Basics: one-one and onto
  4. The range is [0,∞)[0, \infty)

    Step 2 shows every output is ≥0\ge 0⁠. Conversely every y≥0y \ge 0 is reached: y\sqrt{y} is a real number and f(y)=(y)2=yf(\sqrt{y}) = (\sqrt{y})^2 = y⁠. So

    Range of f={y∈R:y≥0}=[0,∞)≠R.\begin{aligned} \text{Range of } f &= \{y \in \R : y \ge 0\} \\ &= [0, \infty) \ne \R. \end{aligned}

    The range is not the whole codomain, which again shows (by the Remark after Definition 6) that ff is not onto. Every negative number is missed, not just −2-2⁠.

    Knowing the exact range explains how to repair the function. If we shrink the codomain to [0,∞)[0, \infty)⁠, ff becomes onto; if we also shrink the domain to [0,∞)[0, \infty)⁠, it becomes one-one too, and then y\sqrt{y} is its inverse.
    ff is onto exactly when its range equals its codomain.
  5. Conclude

    ff is not one-one (Step 1) and not onto (Step 3). So f:R→R, f(x)=x2f : \R \to \R,\ f(x) = x^2 is neither one-one nor onto.

    Each failure was established with its own counterexample, so both halves of "neither … nor" are proved. Compare Exercise 1.2 Q2, where the same formula x2x^2 is tested on N\N and Z\Z⁠: on N\N there are no negative inputs, so squaring becomes one-one there.
Result

f(x)=x2f(x) = x^2 on R\R is not one-one, since f(−1)=1=f(1)f(-1) = 1 = f(1) with −1≠1-1 \ne 1⁠, and not onto, since x2≥0x^2 \ge 0 for every real xx⁠, so −2-2 (indeed every negative number) has no preimage. Its range is [0,∞)[0, \infty)⁠.

Check it with numbers

Squares of −3,−2.5,−1,0,0.5,2,3-3, -2.5, -1, 0, 0.5, 2, 3 are 9,6.25,1,0,0.25,4,99, 6.25, 1, 0, 0.25, 4, 9⁠: none is negative, and 99 appears twice (from ±3\pm 3⁠), just like 1 from ±1\pm 1⁠. Trying to hit −2-2 numerically: the smallest value x2x^2 takes on any list of reals is at least 0, so it can never equal −2-2⁠.

Common mistakes
  1. Saying "x2=−2x^2 = -2 gives x=−2x = \sqrt{-2}". −2\sqrt{-2} is not a real number, and the domain is R\R⁠. This is exactly why there is no preimage.
  2. Choosing a positive number as the counterexample for onto. Every y≥0y \ge 0 is reached (by y\sqrt{y}⁠). Only negative numbers work as counterexamples.
  3. Proving only one half. "Neither one-one nor onto" requires both failures.
  4. Using f(0)f(0) for the one-one counterexample. 00 and −0-0 are the same number, so they are not two different inputs. Use a non-zero pair such as ±1\pm 1⁠.
What to take away
  1. Any function with f(−x)=f(x)f(-x) = f(x) (an even function) fails to be one-one on a set containing some a≠0a \ne 0 and −a-a⁠.
  2. To show onto fails, find a value outside the range, and prove that it is outside, for example by an inequality like x2≥0x^2 \ge 0⁠.
  3. Restricting domain or codomain can repair a function: x2x^2 from [0,∞)[0,\infty) to [0,∞)[0,\infty) is a bijection.

Every fact used, and where it comes from

FactUsed inSource
Definition of one-oneStep 1Definition 5, Section 1.3 (Lesson: types of functions)
Definition of onto; onto   ⟺  \iff range = codomainSteps 3, 4Definition 6 and the Remark after it, Section 1.3
(−a)2=a2(-a)^2 = a^2Step 1Sign rule for products
x2≥0x^2 \ge 0 for all real xxSteps 2, 3Sign rule for products, by cases
(y)2=y(\sqrt{y})^2 = y for y≥0y \ge 0Step 4Definition of the square root
Graph of y=x2y = x^2Step 3 figureFig 1.4, Section 1.3
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →