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?
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$.