Surjective and non injective function problem

315 Views Asked by At

Is there an example for a function which is surjective but not injective with this given: $f\colon \Bbb N\rightarrow \Bbb N \left(\forall m,n\in\Bbb N\right):m\leq n \Rightarrow f(m)\leq f(n)$?

2

There are 2 best solutions below

9
On BEST ANSWER

Try $$f(x)=\left\lfloor\frac x2\right\rfloor$$

0
On

$f(0)=0$, $f(n)=n-1$ for $n\ge 1$.