Hello,

This has to do with Bézout's theorem (I don't know if you are allowed to use it).

Bézout's identity :

Let . There exist such that :

.

Bézout's theorem/lemma :

.

--------------------------

Going back to the problem :

Rewriting (1) :

Show therefore, that we can "divide" by a by multiplying the congruence by the corresponding b:

Multiplying by b each side :

But we know that

Therefore

-->

You can do the reverse implication exactly the same way.

Whew!