We denote the equivalence relation by $\equiv$.
By the assumption, $a \equiv a'$ and $b \equiv b'$ imply $a + a' \equiv b + b'$. In particular, $a \equiv a'$ implies $a + b \equiv a' + b$ for every $b \in \mathbb{Z}$. Hence $a \equiv 0$ implies $-a \equiv 0$.
Let $I = \\{a \in \mathbb{Z}\colon a \equiv 0\\}$. If $I = 0$, then $\equiv$ is clearly equality. So we suppose $I \
eq 0$. Let $n$ be the least positive integer belonging to $I$. Let $x \in I$. $x$ can be written as $x = nq + r$, where $q, r \in \mathbb{Z}$ and $0 \le r < n$. Since $nq \in I$, $r = x - nq \in I$. Hence $r = 0$. Hence $I = \mathbb{Z}n$. Therefore the equivalence relation is defined by mod $n$.