Why do we need to note $\mathrm{ran}( f) \subset \mathbb{Z}$while proving $\mathbb{N}\approx \mathbb{Z}$? One of my textbook examples proves that $\mathbb{N}$ is equinumerous with $\mathbb{Z}$. The given solution is as follows:
Define $f: \mathbb{N} \to \mathbb{Z} $ by $$f(n) = \begin{cases}
n/2,  & \text{if $n$ is even} \\
\frac{-(n-1)}{2}, & \text{if $n$ is odd}
\end{cases}$$
Note that $\mathrm{ran}(f) \subset \mathbb{Z} $ (so that $\mathbb{Z}$ is a reasonable codomain), since if $n$ is even, then $\frac{n}{2} \in \mathbb{Z}$ and if  $n$ is odd $\frac{-(n-1)}{2} \in \mathbb{Z}$.
And proof that $f$ is bijective follows.
I do not understand why noting that $\mathrm{ran} (f)\subset \mathbb{Z} $ is sufficent to prove that I can map every element in  $\mathbb{N}$ to an element of $\mathbb{Z}$? Do I actually need to prove that  $\mathrm{ran}(f) = \mathbb{Z}$?
Thank you.
 A: They are not asserting that their argument is enough.
Rather, because the definition of $f$, which is purported to be a bijection between $\mathbb{N}$ and $\mathbb{Z}$, involves fractions, it could conceivably be taking values outside of $\mathbb{Z}$. After all, you are trying to divide, and that can kick you out of $\mathbb{Z}$ and into $\mathbb{Q}$.
Before you start checking that your function is a bijection between $\mathbb{N}$ and $\mathbb{Z}$, you need to make sure it is a function between $\mathbb{N}$ and $\mathbb{Z}$. 
So as a preliminary step to make sure that what you have actually is a function between $\mathbb{N}$ and $\mathbb{Z}$, they are noting that even though the definition involves fractions, the results you get are in fact integers. So that the function does in fact take values where you want them to take them (the integers).
Once we know that the function is in fact a function between the two sets we are interested in, then you go ahead and prove that it is bijective.
That proof will, at some point, involve verifying that the range of $f$ is in fact all of $\mathbb{Z}$ and not merely contained in $\mathbb{Z}$.
In many instances when you are trying to establish a bijection, the fact that the function you define is a function between the two sets you want is obvious, so you don’t need to argue that. But here, it may be a bit tricky to notice it (again, because you usually need to be wary when you are dividing integers if you want to make sure you remain in the integers). 
