Prove that a function is bijective. I have trouble solving the following problem.
Let $p$ be an integer and $[{0,p-1} ] $ the set of integers between $0$ and $p-1$. Show that the function $(q,r) \rightarrow pq+r$ is a bijection from $\mathbb{N} \times[{0,p-1} ]$ to $\mathbb{N} $. Show that the product of a finite set with $\mathbb{N}$ is countable. 
Here is my attempt to solve this:
I have to prove that the function is surjective and injective.
Surjective: take any $n \in \mathbb{N} $. Then for all $n \in \mathbb{N} $ there exists $r \in [{0,p-1} ]$ and $q \in \mathbb{N}$ s.t. $n= pq+r$
Then: $r= n-pq$ and $0 \le r\le p-1$. Thus we have $pq \le n \le p(q+1) -1$. For this condition, $n$ can exist in the naturals.(Is this a valid argument??)
However, I dont know how to prove this for $q$ as $q= (n-r)/p$ since it doesnt seem conclusive that for all $n$ there exists a $q$.
For the injective part, I have no idea, as $pq+r = pq'+r'$ just doesnt seem to imply that $q=q'$ and $r=r'$.
PS: The naturals are considered to contain 0. Also, the wording of the question is a bit vague, as $p$ should really be considered (I think) to be in the positive integers.
 A: You're doing wrong the surjectivity part: you are assuming the map is surjective in order to show it is surjective, which gets you nowhere.

The statement can be rewritten in a simpler way, without maps. Also $p>0$ must be assumed or the statement is meaningless.

For any $n\in\mathbb{N}$, there exist and are unique $q\in\mathbb{R}$ and $r\in[0,p-1]$ such that $n=pq+r$.

Uniqueness. Suppose $n=pq+r=pq'+r'$, where $q,q'\in\mathbb{N}$ and $r,r'\in[0,p-1]$. Without loss of generality, we can assume $r\le r'$. Then $q\ge q'$ (why?) and
$$
0\le r'-r=p(q-q')<p
$$
If $q-q'>0$, $p(q-q')\ge q$, so we have $q-q'=0$ and so also $r=r'$.
Existence. This is done by induction. The case $n=0$ is obvious: $0=p\cdot0+0$. Suppose $n>0$ and that the statement holds for all integers $m$ with $0\le m<n$. If $n<p$, then $n=p\cdot 0+n$ and $n\in[0,p-1]$ by assumption. If $n\ge p$, then $n-p<n$ and so, by the induction hypothesis, $n-p=pq+r$ for some $q\in\mathbb{N}$ and $r\in[0,p-1]$. Therefore $n=p(q+1)+r$ and we're done.
