The following is from "Multiplicative number theory I: Classical theory" by Hugh L. Montgomery, Robert C. Vaughan:
I understand everything in the proof except for:
How existence of $c$ such that $(c,q)=1$ and $cm \equiv n$ (mod $q$) is guaranteed?
The following is from "Multiplicative number theory I: Classical theory" by Hugh L. Montgomery, Robert C. Vaughan:
I understand everything in the proof except for:
How existence of $c$ such that $(c,q)=1$ and $cm \equiv n$ (mod $q$) is guaranteed?
Copyright © 2021 JogjaFile Inc.

Since $\chi(mn)\ne0$, we have $(mn,q)=1$ and hence $(m,q)=1$. Therefore one can choose $c\equiv m^{-1}n$ (mod $q$) to obtain $cm\equiv n$ (mod $q$).