The problem is from Borevich and Shafarevich's number theory.
Show that the equation $a_1x_1 + \cdots +a_nx_n = b$, where $a_1,\ldots,a_n,b$ are integers, is solvable if and only if the corresponding congruence is solvable for all values of the modulus $m$.
Frankly, I am at a loss of how to approach the $\impliedby$ direction. I would appreciate some hints to get me started in the right direction.