The function $f: \{ 0,1,2,3... \} \to B$ where $f(n)=\left \lfloor \frac{n-1}{2} \right \rfloor$.Prove that it is an onto function if the codomain is $\{-1,0,1,2,3,...\}$ .
My work:
I use the flooring property but I am stuck.
Lets $\left \lfloor \frac{n-1}{2} \right \rfloor$=b,
$b ≤ \frac{n-1}{2} < b+1$
$2b+1 ≤ n <2b+2$
$n∈[2b+1,2b+2)$
Then how to determine $n=2b+1$ or $n=2b+2$ should i take to substitute to $\left \lfloor \frac{n-1}{2} \right \rfloor$ to prove that it is an onto function. Are there have a method can prove onto function strictly?