Let $f: \mathbb R\to \mathbb R$ be defined by $f(x)=|x-1|$. Show that $f$ is neither one one nor onto function.

My Attempt: $$f(x)=|x-1|$$

For all $x \in \mathbb R$, the set of values of $f(x)$ are non negative real numbers. So, range of $f(\mathbb R)=[0, \infty)$. Hence, $f$ is not onto.

  • 1
    $\begingroup$ Certainly the not one to one part is clear... what inputs give, say, 1? $\endgroup$ – Sean Roberson Jul 16 '17 at 7:27
  • 2
    $\begingroup$ Use $f(2)=f(0)$ $\endgroup$ – Fakemistake Jul 16 '17 at 7:27
  • $\begingroup$ We have $f(x)\geq 0$. $\endgroup$ – Wuestenfux Jul 16 '17 at 8:08
  • $\begingroup$ What is the preimage of, say, ...$-1$? $\endgroup$ – Alvin Lepik Jul 16 '17 at 8:32

In order to be one to one, it should be valid that for every $x\neq y$ we have that $f(x)\neq f(y)$. Well, try $x=a+1$ and $y=1-a$, for every $a>0$. We have that: $$f(a+1)=|a+1-1|=|a|=|-a|=|1-a-1|=f(1-a)$$ So, $f$ is clearly not one to one.

Since $$f(x)=|x-1|\geq0$$ it is also ivedent that $f$ is not onto $\mathbb{R}$.

Note: If we define $f:\mathbb{R}\to[0,+\infty)$ $f$ would be onto $[0,+\infty)$.


$f$ is not one-to-one because exists $x\neq y\in\mathbb{R}$ such that $f(x)=f(y)$, for example, $x=0, y=2$.

$f$ is not onto because $f(x)=|x|\ge0$ for all $x\in\mathbb{R}$, then there is no $x$ such that $f(x)=-1$ (for example).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.