I have already proved that there is a solution, and I have seen many proofs that simply state that there are obviously $\gcd(a, n)$ solutions of the form:
$$x_0, x_0 + \frac{n}{g}, x_0 + \frac{2n}{g}, \dots , x_0 + \frac{(g-1)n}{g}$$
This is not obvious to me though, and have no idea how they arrive at this conclusion.
The equation $ax\equiv b\pmod{n}$, knowing that $g=\gcd(a,n)\mid b$, becomes $$ gAx-gB=kgN $$ where $a=gA$, $n=gN$, $b=gB$. This in turn becomes $$ Ax-B=kN $$ or $Ax\equiv B\pmod{N}$. Note that $\gcd(A,N)=1$, so $A$ is invertible modulo $N$. Thus there exists $C$ with $AC\equiv 1\pmod{N}$ and therefore the equation becomes $x\equiv BC\pmod{N}$. There is a single $x_0$, with $0\le x_0<N$ satisfying this condition.
Clearly, $x_0$ is also a solution to $ax\equiv b\pmod{N}$.
Similarly, there is a single solution $x_1$ satisfying $N\le x_1<2N$, and, more generally, a single solution $x_k$ satisfying $kN\le x_k<(k+1)N$, namely $$ x_k=x_0+kN $$
Note that, for $0\le h<g$ and $0\le k<g$, $x_h\not\equiv x_k\pmod{n}$. Thus we have found exactly $g$ solutions $x_0,x_1,\dots,x_{g-1}$.
Each solution to $ax\equiv b\pmod{n}$ is congruent to one of these modulo $n$.