When finding the solutions of $$ax \equiv b\pmod{n}$$ I've been given an algorithm which starts by testing that the $\text{gcd}(a, n)|b$.
How can I show (for understanding better the topic) that if $b$ is not a multiple of $\text{gcd}(a,n)$, the congruence above can't have any solution?