Bijective proof involving floor functions Could someone lead me in the direction of how to prove that this function is injective and surjective?
$f:\mathbb N→\mathbb N$ defined by $f(n)= (-1)^n \cdot \lfloor\frac n2\rfloor$
I understand what it means for a function to be injective and surjective, but I'm unsure how the floor function factors into this proof.
 A: To prove $f$ is injective, assume that $f(n) = f(k)$, and then reason about the resulting algebra until you conclude that $n = k$. Then you're done with that part. 
You can show your work by editing your question, showing how far you got, and perhaps we can help you further. 
To show $f$ is surjective, let $w$ be any element of $\Bbb N$ (or more likely $\Bbb Z$, as @egreg suggests), and see if you can figure out what element $n \in \Bbb N$ has $f(n) = w$. This'll be easiest if you divide into the cases $ w = 0, w > 0, w < 0$. 
A: If it wasn't for the floor function, $f$ would not have $\mathbb Z$ as codomain (following egreg I'm assuming that's what you mean). We have
$$f(1)=0, f(2)=1, f(3)=-1, f(4)=2,\ldots,$$
while the function $g:\mathbb N\to\mathbb Q$ defined by $g(n)=(-1)^n\cdot\frac n2$ gives
$$g(1)=-\frac12, g(2)=1, g(3)=-\frac32, g(4)=2,\ldots$$
Is that enough of a hint to help you with the proof?
A: 
When I looked at the question I just assumed $0 \in \mathbb N$. So it
  looks like my work answers a slightly different question. But the
  ideas are what counts so I am leaving it as is.

When you examine
$\quad f\colon\mathbb{N}\to\mathbb{Z}$
$\quad f(n)= (-1)^n \cdot \lfloor\frac{n+1}{2} \rfloor$
realize that several things are going on - you are multiplying two functions together, the floor function (with a change of variable) and $Alt(n) = (-1)^n$,  and adjusting the domain and codomain to get the function $f$.
If that is confusing, you can also directly define the function $f$ (actually a sequence). This might also be confusing, but sometimes doing the same thing in two different ways can add insight. 
Define $f\colon\mathbb{N}\to\mathbb{Z}$ as follows:
$f(n) = \left\{\begin{array}{lr}
        \;\;\;0\, \;\;\;\text{ |} & \text{for } n = 0\\
        -m \;\;\; \text{ |} & \text{for } n = 2m - 1\\
        +m \;\;\;\text{ |} & \text{for } n = 2m\\
         & \text{where } m \ge 1
        \end{array}\right\}$
Exercise 0: Check what $f$ does with the inputs $0$, $1$, $2$, $3$, $4$, and $5$.
Exercise 1: Show that the two definitions for $f$ are indeed equivalent.
Exercise 2: Show, using the second formulation, that $f$ is a bijection.
Exercise 3: Show, using the original formulation, that $f$ is a bijection.
