Help in this proof of Niven, Zuckerman, Montgomery's number theory book I'm reading Niven, Zuckerman, Montgomery's number theory book and on page 51 they state this theorem:

Theorem 2.6: Let $(a,m)=1$. Let $r_1,r_2,\ldots, r_n$ be a complete, or a reduced, residue system modulo $m$. Then
  $ar_1,ar_2,\ldots,ar_n$ is a complete, or a reduced, residue system,
  respectively, modulo $m$.
Proof: If $(r_i,m)=1$, then $(ar_i,m)=1$ by theorem 1.8. There are the same number of $ar_1,ar_2,\ldots,ar_n$ as of
  $r_1,r_2,\ldots,r_n$. Therefore we need only show that $ar_i\not\equiv
 ar_j\pmod m$ if $i\neq j$. But thereom 2.3, part 2, shows that
  $ar_i\equiv ar_j \pmod m$ implies $r_i\equiv r_j \pmod m$ and hence
  $i=j$

I didn't understand why every integer is a residue of some of $ar_1,\ldots,ar_j$ modulo $m$.

Note that for each $i$, there exists a unique $j$ such that $ar_i\equiv r_j\pmod{m}$.  Let's write $f(i)$ for this unique $j$ (depending on $i$).  The argument given shows that $f$ is an injective function from $\{1,\dots,n\}$ to $\{1,\dots,n\}$, since $ar_i\not\equiv ar_j\pmod{m}$ if $i\neq j$.  Any injective function from a finite set to itself is also surjective, so $f$ is surjective.  This means that for any $j$, there exists an $i$ such that $ar_i\equiv r_j\pmod{m}$.  For any integer $x$, there is by assumption some $j$ such that $x\equiv r_j\pmod{m}$, and hence some $i$ such that $x\equiv ar_i\pmod{m}$.
