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

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.

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