I want to show that for $a,b,n \in \mathbb{Z}$, if $\gcd ( a, b) = 1$ and $a \equiv b$ mod $n $, then $\gcd (a, n) = 1$. My attempt is as follows:
Given : $\gcd (a, b) =1 \implies \exists x, y \in \mathbb{Z}$ such that $a*x + b * y = 1$.
I got $b= \frac{(1 - (a*x))}{y}$.
Substituting this in $a \equiv b$ mod $n $, I got $a * (x + y) \equiv 1 $ mod $n$.
However, I am not able to proceed further as I do not know how to show that $\gcd (x+y,a) =1$.