Prove that $\langle[a]\rangle=\langle[b]\rangle$ in $\mathbb Z_n$ iff $\gcd(a,n)=\gcd(b,n)$.
Can anyone help?
Is it correct for => side?
Since $[a] = [b], a ≡ b \text{ mod } n$ by the definition of congruence modulo $n$ $$a − b = nk$$ for some $k \in \mathbb{Z}$. this implies $$a = nk + b$$
if $x, y, q, r \in \mathbb{Z}$ and $x = yq + r$, then $\gcd(x, y) = \gcd(y, r)$ taking $x = a$ and $y = n$.
Thus, $$\gcd(a, n) = \gcd(n, b)$$
I have no idea for <= side I stuck with this question for a long time :(
No.
One problem with your proof is that we cannot deduce $[a]=[b]$ from $\langle [a]\rangle=\langle [b]\rangle$. For example, in $(\Bbb Z_{10}, +_{10})$, we have that
$$\begin{align} \langle[3]\rangle &=(\{[3], [6], [9], [2], [5], [8], [1], [4], [7]\}, +_{10}) \\ &=(\Bbb Z_{10}, +_{10}) \\ &=(\{[7], [4], [1], [8], [5], [2], [9], [6], [3]\}, +_{10}) \\ &=\langle [7]\rangle, \end{align}$$
yet
$$\begin{align} [3]&=\{ 3+10k\mid k\in\Bbb Z\} \\ &\neq\{ 7+10\ell\mid \ell\in\Bbb Z\}\quad(\text{because }3\neq 7+10\ell_0\text{ for any }\ell_0\in\Bbb Z) \\ &=[7]. \end{align}$$
Hint: We have $\langle [a]\rangle=\langle [b]\rangle$ iff both $[a]\in\langle [b]\rangle$ and $[b]\in\langle [a]\rangle$. Recall what a "power of $[x]$" means for $[x]\in\Bbb Z_n$. Use Bézout's Identity.