<s>[INST] find a solution of 9x = 24 (mod 21) I need help finding a solution of $9x\equiv {24}\pmod {21}$.
Here is what I tried, but it's wrong.
mod x is the positive value of x. mod $21 = 21.$
$9x\equiv {24}\pmod {21}$.
$9x = 24*21$
$x = 24*21/9 = 56$
 [/INST] Since $21=3\cdot 7$ and $(3,7)=1$, we have:
$$9x\equiv 24\pmod{21}\Leftrightarrow 9x\equiv 24\pmod{3}\wedge9x\equiv 24\pmod{7}$$
Now, $9x\equiv 24\pmod{3}\Leftrightarrow 0x\equiv 0\pmod{3}$, which is always true and 
$$9x\equiv 24\pmod{7}\Leftrightarrow 2x\equiv 3\pmod{7}\Leftrightarrow 4\cdot2x\equiv 4\cdot 3\pmod{7}\Leftrightarrow x\equiv 5\pmod{7}$$
</s>