0
$\begingroup$

f:N->Z, and 0 in N and [x] means the "floor" of x. I started by letting n,m in N and f(n)=f(m).

I got down to

$$(-1)^m[(m+1)/2] = (-1)^n[(n+1)/2]$$

But I'm pretty sure that doesn't imply that n=m yet. Am I on the right track, and if not how should I do differently?

Any hints for showing the surjection would be appreciated as well.

1 Answers 1

1

If you list out of the values for $f(0), f(1), f(2),$ and so on, you should notice a pattern and be able to show surjectivity.

To show injectivity, without loss of generality suppose that $n>m$. Dividing both sides of your equality by $(-1)^{n+1}$ yields $$ (-1)^{n-m} [\frac{n+1}{2}] = [\frac{m+1}{2}]. $$ Because of the $-1$ part, this means that $n$ and $m$ both have to have the same parity (both must be even, or both must be odd). There are then 2 cases: $n$ and $m$ are odd, or $n$ and $m$ are even. Consider both of those cases and you'll get the answer.