Prove that $f(n)=(-1)^n\lceil{\frac{n}{2}}\rceil$ is bijective. 
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.
 A: Check out the pattern: $(f(0),f(1),f(2),\ldots)=(0,-1,1,-2,2,-3,3,\ldots)$.  The nonpositive integer outputs come from even inputs, and the negative integer outputs come from the odd inputs. 
This leads to realizing that the following function undoes $f$. Define $g:\mathbb Z\to\mathbb N$ by $g(n)=2n$ when $n\geq 0$, and $g(n)=-2n-1$ if $n$ is odd.  This is the inverse function of $f$. You can show this by showing that $f(g(n))=n$ for all $n\in\mathbb Z$, and $g(f(n))=n$ for all $n\in\mathbb N$.  These equations imply that $f$ is bijective. 
(This is an alternative approach to your equivalent approach of verifying directly from the definitions that $f$ is injective (and then surjective), and Mengchun Zhang had already answered your question of how to complete your attempt at showing injectivity.)  
A: Since the domain is $\mathbb N$, we have $a\geq0,\ b\geq0$, and so $\lceil\frac a2\rceil\geq0,\ \lceil\frac b2\rceil\geq0$ 
If $\,a-b\,$ is odd, then
$$\lceil\frac a2\rceil\ =\ -\lceil\frac b2\rceil$$
The equality holds only if $\,a=b=0$, but that is a contradiction of $a-b$ being odd 
So $a-b$ must be even and that gives $a=b$, which is the result you have gotten
