The equation \(x \equiv a \pmod{m}\) has a solution since \(a + km\) satisfies the equation for all \(k \in {\mathbb Z}\text{.}\) We must show that there exists an integer \(k_1\) such that
\begin{equation*}
a + k_1 m \equiv b \pmod{n}\text{.}
\end{equation*}
This is equivalent to showing that
\begin{equation*}
k_1 m \equiv (b-a) \pmod{n}
\end{equation*}
has a solution for \(k_1\text{.}\) Since \(m\) and \(n\) are relatively prime, there exist integers \(s\) and \(t\) such that \(ms + nt = 1\text{.}\) Consequently,
\begin{equation*}
(b-a) ms = (b-a) -(b-a) nt\text{,}
\end{equation*}
or
\begin{equation*}
[(b-a)s]m \equiv (b-a) \pmod{n}\text{.}
\end{equation*}
Now let \(k_1 = (b-a)s\text{.}\)
To show that any two solutions are congruent modulo \(mn\text{,}\) let \(c_1\) and \(c_2\) be two solutions of the system. That is,
\begin{align*}
c_i & \equiv a \pmod{m}\\
c_i & \equiv b \pmod{n}
\end{align*}
for \(i = 1, 2\text{.}\) Then
\begin{align*}
c_2 & \equiv c_1 \pmod{m}\\
c_2 & \equiv c_1 \pmod{n}\text{.}
\end{align*}
Therefore, both \(m\) and \(n\) divide \(c_1 - c_2\text{.}\) Consequently, \(c_2 \equiv c_1 \pmod{mn}\text{.}\)