Prove if $a\mid b$ and $b\mid a$, then $|a|=|b|$ , $a, b$ are integers.

Solution 1:

From what you wrote, $a=akm$, so $a(1-km)=0$. Also $b=bmk$, so $b(1-km)=0$. Thus either $a=b=0$ (and hence $|a|=|b|$), or $mk=1$. The units in $\mathbb Z$ are of course only $+1$ and $-1$.

Solution 2:

Just continue your idea! $a=bm$, and $b=ak$ implies $a=akm$ and thus $1=km$. Which can only hold for $k=m=\pm1$.

Upd: of course, under $a,b\ne 0$, which comes from the setting.

Solution 3:

$$a /b$$ then $$|a| \le |b|$$ $$b / a $$ then $$ |b| \le |a|$$

thus

$$|a| = |b|$$