The homomorphism associated to congruence modulo n From my understanding of congruence classes, to each group homomorphism $\phi: G \to G'$, there exists an associated congruence relation: $a \equiv b$ if $\phi(a)=\phi(b)$. 
Applying this to congruence modulo n, it seems as if there should exist some homomorphism $\phi: \mathbb{Z} \to \mathbb{Z} /n\mathbb{Z}$ (where the group operation is addition) with 
$$a \equiv b \mod n \quad \text{if} \quad \phi(a)=\phi(b)$$
Does this homomorphism exist? I have tried the following mapping, though it fails to be a homomorphism:
Let $x \in \mathbb{Z}$, and use division with remainder to write $x = qn+r$ where $q,r \in \mathbb{Z}$ and $0 \leq r < n$. Then, define
$$\phi(x)=\phi(qn+r)=r$$
However, I encounter the following problem: If we let $y \in \mathbb{Z}$ with $y=nq'+r'$, and $r+r'\geq n$, then 
$$\phi(x+y) = \phi((qn+r)+(q'n+r')) = r+r'-n$$
But 
$$\phi(x)+\phi(y)= \phi(nq+r) + \phi(nq'+r') = r+r'$$
So $\phi$ is not a homomorphism. Does anyone have any ideas?
 A: The homomorphism you seek for is defined by
\begin{align}
\varphi:\mathbf Z&\longrightarrow \mathbf Z/n\mathbf Z, \\
x&\longmapsto  [x]=x +n\mathbf Z.
\end{align}
You can check it is a group homomorphism if you consider the correct definition of addition modulo $n$ (I use your notations):
$$[x]+[y]=[r+r']=r+r'+n\mathbf Z.$$
You can even check it is actually a ring homomorphism since $[1]=1+n\mathbf Z\;$ is the multiplicative unit, and $\;[x][y]=[xy]=rr'+n\mathbf Z$.
A: The homomorphism you're interested in is $\phi:\Bbb Z\to\Bbb Z_n$ given by $\phi (x)=x\pmod n$.
Then $\operatorname {ker}\phi=n\Bbb Z$.
In general, since we are considering a homomorphism $\phi: G\to G'$, the congruence $a\cong b$ if $\phi(a)=\phi (b)$, just means $\phi (ab^{-1})=e$.  That is, $ab^{-1}\in\operatorname {ker}\phi$.
The kernel of a homomorphism is always a normal subgroup;   and there is a canonical submersion from $s:G\to\dfrac G{\operatorname {ker}\phi}$.
Moreover, this quotient has a universal property:  for any homomorphism $\phi: G\to G'$, $\phi$ "factors through $s$". That is, there exists a homomorphism $\bar \phi:\dfrac G{\operatorname {ker}\phi}\to G'$ such that $\phi=\bar\phi\circ s$.
In our case, $\phi$ turns out to be the canonical submersion $s:\Bbb Z\to\Bbb Z_n$.
