Can someone please verify/explain why this solution works? I just know how to do it but I want to know why it works!
$5x\equiv 1\;\;(mod\;\;6)$
$5x = 1 + 6y$
$5n = -4 + y \;\;(mod \;\;5)$
$y = 5n + 4$
$5x = 1 + 6(5n + 4) = 1 + 5(6n) + 24 = 25 + 5(6n)$
$x = 5 + 6n, \;\; n\in \mathbb{Z}$
Solving $$5x\equiv 1\;\;(mod\;\;6)$$ means finding all $x\in (0,1,2,3,4,5)$ which satisfy $ 5x=6k+1.$
Upon checking those numbers, we find that $x=5$ is the only one satisfying the equation.
Therefore the answer is $x=6k+5.$