Question. Suppose that positive integers $a,b,n$ satisfy $d=\gcd(a,n)=\gcd(b,n)$. Prove that then there are integers $x,y$ coprime to $n$ with $ax=b$ and $by=a$ modulo $n$.
I doubt this is true. First let integer $r$ be such that$$r\left(\frac a d\right)\equiv 1\left(\operatorname{mod}~\frac n d\right)$$
Of course finding $x$ with $ax=b$ modulo $n$ is just picking a solution $x$ in the form $$x_k=r\left(\frac b d\right)+k\left(\frac n d\right)=\frac{rb+kn}{d}~~(k=0,1,...,d-1).$$What is tricky is I need to show such $x_k$ is coprime to $n$ for some $k$. Actually it is sufficient to find $k$ such that $x_k$ is coprime to $d$. How could you pick such $k$?
For counterexamples, first note that the question is true when $d=1$, and in general it is true if $\gcd(a/d,n)=\gcd(b/d,n)$=1. It is also true when $n$ divides $a$ and $b$, because then $x=1$ would work...