Prove that $f(n)=(-1)^n\lceil{\frac{n}{2}}\rceil$ is bijective.
Where $f:\mathbb{N}\mapsto\mathbb{Z}$ and $\lceil x\rceil$ is the ceiling function.
I started by trying to prove that $f$ is injective.
\begin{align} f(a)&=f(b)\\ (-1)^a\left\lceil\frac{a}{2}\right\rceil&=(-1)^b\left[\frac{b}{2}\right]\\ (-1)^{a-b}\left\lceil\frac{a}{2}\right\rceil&=\left\lceil\frac{b}{2}\right\rceil \end{align}
if $a-b$ is even, then clearly $a=b$, but if it is odd then $a+b=-1$ which is indeed impossible.
Does that mean that this function is not injective?
So I don't know how to tackle this problem.