<s>[INST] Canonical Complete Residue System $\pmod 7$ Find all solutions in the canonical complete residue system modulo $7$ of the congruence
$$3x \equiv 2 \pmod 7$$
I know that there is a unique solution, because $\operatorname{gcd}(3, 7)=1$ which is obviously a divisor of $2$. However, I don't exactly where I need to go from there in order to get to the general solution. 
 [/INST] To solve the congruence $3x \equiv 2 \pmod{7}$, we can apply the extended Euclidean algorithm.
$$7 = 2 \cdot 3 + 1$$
Solving for $1$ yields 
$$1 = 7 - 2 \cdot 3$$
Hence, 
$$3 \cdot -2 \equiv 1 \pmod{7}$$
Multiplying both sides of the congruence by $2$ yields
$$3 \cdot -4 \equiv 2 \pmod{7}$$
Since $-4 \equiv 7 - 4 \equiv 3 \pmod{7}$, we obtain
$$3 \cdot 3 \equiv 2 \pmod{7}$$
Hence, $x \equiv 3 \pmod{7}$.
Check: If $x \equiv 3 \pmod{7}$, then $3x \equiv 3 \cdot 3 \equiv 9 \equiv 7 + 2 \equiv 2 \pmod{7}$.
</s>