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

Exercise 1.2 · Q4: The modulus function

Exercise 1.2Types of functions · Exercise 1.2
The question

Show that the Modulus Function f:R→Rf : \R\to\R⁠, given by f(x)=∣x∣f(x) = |x|⁠, is neither one-one nor onto, where ∣x∣|x| is xx⁠, if xx is positive or 0 and ∣x∣|x| is −x-x⁠, if xx is negative.

Exam answer

f(−1)=∣−1∣=1f(-1) = |-1| = 1 and f(1)=∣1∣=1f(1) = |1| = 1⁠, but −1≠1-1 \ne 1⁠. So ff is not one-one.

∣x∣≥0|x| \ge 0 for every x∈Rx \in \R⁠, so −1∈R-1 \in \R is not the image of any xx⁠. So 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

The modulus throws away the sign of a number and keeps its size. Throwing away the sign means aa and −a-a always give the same output, so the function is not one-one. Keeping only the size means the output is never negative, so a negative number in the codomain R\R⁠, such as −1-1⁠, is never produced: not onto. Because ∣x∣|x| is defined by two formulas, each claim is checked separately for x≥0x \ge 0 and for x<0x < 0⁠.

Given, to show, and the plan
Given
f:R→Rf : \R\to\R with f(x)=xf(x) = x if x≥0x\ge0 and f(x)=−xf(x) = -x if x<0x<0⁠.
To show
ff is not one-one, and ff is not onto.
Plan
(1) Confirm the two formulas give exactly one output for each xx⁠. (2) Not one-one: compute f(−1)f(-1) and f(1)f(1) with the correct pieces. (3) Not onto: show ∣x∣≥0|x|\ge 0 in both cases, so −1-1 is never an image. (4) Conclude, and see how changing the domain or codomain changes the answer.

Basics you need

1A function defined in pieces

To evaluate ∣x∣|x|⁠, first decide which piece xx belongs to (x≥0x \ge 0 or x<0x < 0⁠), then use only that formula. Examples: ∣3∣=3|3| = 3 (since 3≥03\ge0⁠), ∣−3∣=−(−3)=3|-3| = -(-3) = 3 (since −3<0-3<0⁠), ∣0∣=0|0| = 0⁠. Basics: what a function is

2One-one and onto

One-one: f(x1)=f(x2)⇒x1=x2f(x_1) = f(x_2) \Rightarrow x_1 = x_2 for all inputs (Definition 5). Onto: every yy in the codomain is f(x)f(x) for some xx in the domain (Definition 6). Basics: one-one and onto

3Counterexamples

"Not one-one" is shown by one pair x1≠x2x_1\ne x_2 with f(x1)=f(x2)f(x_1) = f(x_2)⁠. "Not onto" is shown by one codomain value yy together with a proof that f(x)≠yf(x) \ne y for every xx⁠. Basics: how to prove and disprove

4The negative of a negative is positive

If x<0x < 0⁠, then −x>0-x > 0 (multiplying an inequality by −1-1 reverses it). This is what makes ∣x∣|x| non-negative on the second piece. Basics: integers, even and odd

Solution

  1. The two formulas define one output for each xx

    Every real number xx satisfies exactly one of x≥0x \ge 0 and x<0x < 0⁠. So exactly one of the two formulas applies, and it gives one real number: xx or −x-x⁠. Hence ff is a function from R\R to R\R⁠.

    With a piecewise definition it is worth confirming that the pieces do not overlap (which could give two outputs) or leave gaps (which could give none). Here the condition "positive or 0" and the condition "negative" split R\R cleanly, with 00 in the first piece.
    Evaluate a piecewise function by first choosing the piece (Basic 1).
  2. Not one-one: f(−1)=f(1)f(-1) = f(1)

    Compute each value using the correct piece:

    −1<0 ⟹ f(−1)=−(−1)=1,1≥0 ⟹ f(1)=1.\begin{aligned} -1 < 0 \ &\Longrightarrow\ f(-1) = -(-1) = 1,\\ 1 \ge 0 \ &\Longrightarrow\ f(1) = 1. \end{aligned}

    So f(−1)=f(1)=1f(-1) = f(1) = 1 although −1≠1-1 \ne 1⁠. Hence ff is not one-one.

    The same happens for every a>0a > 0⁠: f(−a)=−(−a)=a=f(a)f(-a) = -(-a) = a = f(a)⁠. Every positive output is shared by exactly two inputs, aa and −a-a⁠.

    A single pair of different inputs with equal outputs disproves one-one, because one-one is a claim about all pairs. We choose 11 and −1-1 because they sit in different pieces and the arithmetic is easy. The general line f(−a)=f(a)f(-a) = f(a) shows the failure is not an accident of one pair; it is built into the definition (the sign is discarded).
    One counterexample disproves a "for all" statement (Basic 3). Basics: how to prove and disprove
  3. ∣x∣|x| is never negative

    Check each piece:

    • If x≥0x \ge 0⁠, then f(x)=x≥0f(x) = x \ge 0⁠.
    • If x<0x < 0⁠, then f(x)=−x>0f(x) = -x > 0⁠, by Basic 4.

    Since the two cases cover all real numbers, f(x)≥0f(x) \ge 0 for every x∈Rx\in\R⁠.

    This is the fact the onto argument needs, and it must be proved for both pieces. It would not be enough to look at the first formula f(x)=xf(x) = x⁠, which on its own can be negative; for negative xx that formula is not the one in use.
    Multiplying x<0x<0 by −1-1 reverses the inequality: −x>0-x>0 (Basic 4).
  4. Not onto: −1-1 is never an output

    The number −1-1 is in the codomain R\R⁠. By Step 3, f(x)≥0>−1f(x) \ge 0 > -1 for every x∈Rx\in\R⁠, so f(x)≠−1f(x) \ne -1 for every xx⁠. No element of the domain is mapped to −1-1⁠, and ff is not onto.

    −3−2−1123 xy (−1, 1) (1, 1) y = 1: hit twice y = −1: never reached y = −x for x < 0 y = x for x ≥ 0 231−1
    The graph of y=∣x∣y = |x| (scales differ): the line y=−xy = -x on the left of the origin and y=xy = x on the right. The horizontal line y=1y = 1 meets it twice, at (−1,1)(-1, 1) and (1,1)(1, 1)⁠, so ff is not one-one. The whole graph lies on or above the xx-axis, so the line y=−1y = -1 never meets it and ff is not onto R\R⁠.
    To disprove onto we must name a value in the codomain and show that no input gives it. Choosing a negative value makes this immediate, because Step 3 already proved that all outputs are ≥0\ge 0⁠. Any negative number would do; non-negative numbers would not, since every y≥0y \ge 0 is reached (f(y)=yf(y) = y⁠).
    Definition 6: onto means every element of the codomain is an image. Equivalently, the range must equal the codomain; here the range is [0,∞)[0, \infty)⁠, not R\R⁠. Basics: one-one and onto
  5. Conclude, and see how the sets change the answer

    ff is not one-one (Step 2) and not onto (Step 4), so the modulus function f:R→Rf : \R\to\R is neither one-one nor onto.

    The verdict depends on the domain and codomain, not only on the formula ∣x∣|x|⁠:

    • With codomain [0,∞)[0, \infty) (domain still R\R⁠), it becomes onto: any y≥0y \ge 0 equals f(y)f(y)⁠, since y≥0y\ge0 uses the first piece. It is still not one-one, since f(−1)=f(1)f(-1) = f(1)⁠.
    • With domain and codomain both [0,∞)[0, \infty)⁠, only the first piece is ever used, so f(x)=xf(x) = x⁠. Then f(x1)=f(x2)f(x_1) = f(x_2) means x1=x2x_1 = x_2 (one-one), and every y≥0y\ge0 equals f(y)f(y) (onto). So that function is bijective.
    Removing the negative inputs removes the partner −a-a of each aa⁠, which repairs one-one. Shrinking the codomain to the actual range repairs onto. Seeing which change fixes which property is a good check that you understand why each property failed.
Result

f(x)=∣x∣f(x) = |x| from R\R to R\R is not one-one, because f(−1)=f(1)=1f(-1) = f(1) = 1 with −1≠1-1 \ne 1⁠, and not onto, because ∣x∣≥0|x| \ge 0 for every real xx⁠, so −1-1 in the codomain is never an image. Hence it is neither one-one nor onto, as required. (The textbook's answer list gives no entry for this "show that" question; the result is the statement asked for.)

Check it with numbers

∣−2.5∣=2.5=∣2.5∣|-2.5| = 2.5 = |2.5|⁠, ∣−7∣=7=∣7∣|-7| = 7 = |7| and ∣0∣=0|0| = 0⁠: pairs of opposite numbers share an output, and 00 is the only output with a single preimage. A computer check of 20012001 inputs from −10-10 to 1010 in steps of 0.010.01 finds 10011001 different outputs, every one of them ≥0\ge 0⁠; −1-1 never appears.

Common mistakes
  1. Using the wrong piece. f(−1)f(-1) uses −x-x because −1<0-1<0⁠: f(−1)=−(−1)=1f(-1) = -(-1) = 1⁠, not −1-1⁠.
  2. Reading "∣x∣=−x|x| = -x" as "∣x∣|x| is negative". For negative xx⁠, the number −x-x is positive.
  3. Disproving onto with a positive value. Every y≥0y\ge0 is reached. Only negative values are missed.
  4. Forgetting that the answer depends on the sets. On [0,∞)→[0,∞)[0,\infty)\to[0,\infty) the same formula gives a bijection.
What to take away
  1. For a piecewise function, check each claim on every piece, and choose the piece by the input, not by the formula you would like to use.
  2. "Symmetric" functions with f(−a)=f(a)f(-a) = f(a) (such as ∣x∣|x| and x2x^2⁠) are never one-one on a domain that contains some a≠0a \ne 0 together with −a-a⁠.
  3. If all outputs satisfy a restriction (here ≥0\ge 0⁠) that some elements of the codomain fail, the function is not onto: pick a codomain value that breaks the restriction.

Every fact used, and where it comes from

FactUsed inSource
∣x∣=x|x| = x for x≥0x\ge0⁠, ∣x∣=−x|x| = -x for x<0x<0Steps 1 to 5Statement of Exercise 1.2, Q4
x<0⇒−x>0x<0 \Rightarrow -x>0Step 3Order properties of real numbers
Definition of one-oneSteps 2, 5Definition 5, Section 1.3 (Lesson: types of functions)
Definition of onto; onto   ⟺  \iff range = codomainSteps 4, 5Definition 6 and the Remark after it, Section 1.3
Bijective means one-one and ontoStep 5Definition 7, Section 1.3
All numerical values and graph coordinatesCheck, figureRecomputed in the site's verification script
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 →