prove or disprove if $ab\equiv ac \bmod m$ then $b\equiv c \bmod m$
there is a theorem said that this equality holds when gcd(a,m)=1 so I try to find a counterexample to disprove this for example
$2.9 \equiv 2.3 \bmod 9$ because gcd(2,9)=1
then $9\equiv 3 \bmod 6$ holds
$4.6 \equiv 4.3 \bmod 2$ and gcd(4,2)=2
then $6\equiv 3 \bmod 2$ this not holds
$2.6 \equiv 2.2 \bmod 2$ and gcd(2,2)=2
but $6\equiv 2 \bmod 2$ this holds although gcd (a,m) not 1?
$4.6 \equiv 4.2 \bmod 2$ and gcd(4,2)=2
but $6\equiv 2 \bmod 2$ , $2k=4$ why this holds when gcd (a,m) not 1 too?
is this also related to multiplicative inverse? and one more thing I want to ask
if gcd($a,b$)$=1$, then I can write this as $ax+by=1$ for some integers $x$ and $y$. Is gcd($x,y$) has to be $1$ or coprime? if yes why is that? thanks!