Question: If $x, y$ are coprime, then for any integer $a,b$ there is an integer $m$ such that:

$m \equiv a \;(\bmod\; x)$

$m \equiv b \;(\bmod\; y)$

I approached it like this:

Since they are coprime then 

> 
> $xi + yj = 1$
> 
> 
> 

Then

$1 - yj = xi \;\text{ and } \; 1 - xi = yj $

Then 

$1 \equiv yj \;(\bmod\; x) \;\text{ and } \;1 \equiv xi \;(\bmod\; y)$

But unfortunately I am not sure if this approach is correct. Can someone hint me?

Answer: 
There are thre options here: either you are sloppy or the book is or both.

It is pretty easy to show the following fact:

> 
> If $A$ and $B$ are square matrices, then $AB$ is invertible if and only if $A$ and $B$ are invertible.
> 
> 
> 

Using this fact, the proof used in your book is "correct".

1. If the statement above was already proven in your book, then it may be the case that you missed that fact (so you are sloppy)
2. If the statement was not proven in the book, then the book is sloppy.
3. If the statement was proven, but the book did not explain well enough that it was used in the proof you cite, then it may be that both of you are sloppy.
Assume for exemple $AB=I$.
Then $A$ and $B$ represent two linear maps $f$ and $g : \mathbb{R}^n \to \mathbb{R}^n$, $n$ is the size of the matrix.
Then you have $f\circ g= id$, which implies easily that $f$ is surjective and $g$ is injective (1). But in finite dimensional linear algebra, those facts are equivalent $f$ and $g$ to be bijective (2), and you are done with the book's proof...

(1) and (2) are exercises, if you have a problem with you can ask, but it's probably solved somewhere in your book.