Determining Injective, Surjective, Bijective Functions over range of Integers I have been slightly struggling with determining injective or surjective functions.  The issue that I am having is that i'm unclear how to handle different domains.  For example, the current domain is from $\mathbb{Z}$ to $\mathbb{Z}$ and the function is $f(n) = n/2.$
I have been solving these problems (for injective) by setting both sides equal to an arbitrary value i.e. $n_1$ and $n_2$ and solving to make them equal.  My question becomes what if the value you are mapping to does not fall within the domain..in this case $\mathbb{Z}$ to $\mathbb{Z}$.  So if I were to set $n = 1$ for example, we would end up with .5, which is not an integer. Is this still injective?  I apologize if this is a stupid question.  Does the domain only strictly effect inputs and not effect outputs?  Do these rules apply to surjective as well?
 A: If we want a relation to be injective or surjective, it needs to be a function in the first place, which means every element in the domain must match with exactly one element in co-domain (they may match with the same element or different elements). 
In your question odd numbers in the domain don't match with anything so it is not a function at all. As a result, it is not injective. However, if we exclude odd numbers from the domain so that the domain becomes $\mathbb{Z}-\{...,-3,-1,1,3,...\}$, then your function is injective since every element in domain is matched with exactly one element in codomain (so $f$ is a function) and when we choose $n_1$ and $n_2$ such that $f(n_1) = f(n_2)$, we get to $\frac{n_1}{2} = \frac{n_2}{2} \implies n_1 = n_2$. 
A: First thing that you must do is determine domain,then you are going to see if function is injective or surjective.In this case it is easy to see that the domain of this function are even numbers i.e. $n \in \mathbb{Z} $ which satisfies $ n \quad mod\quad 2 = 0$.Now to prove that is injective:
$$ f(n)=f(m) \rightarrow \frac{n}{2}=\frac{m}{2} $$ multyply by $2$ $\rightarrow  m=n $.Thus $f$ is injective.
If $f$ is surjective that means:$$\forall n \in \mathbb{Z} \quad  \exists m \in \mathbb{Z}\quad  f(m)=n$$If we put: $$m=2n \rightarrow f(m)=f(2n)=\frac{2n}{2}=n$$
and that's it $f$ is surjective.
