TITLE: Show that $\gcd(a,b)=\operatorname{lcm}(a,b)$ if and only if $a=b$.
QUESTION [8 upvotes]: I know how to prove $a=b$ only if $\gcd(a,b)=\operatorname{lcm}(a,b)$, but I don't know how to prove the "if part". Can anyone help me?

REPLY [3 votes]: According to the fundamental theorem of arithmetic, for any $a,b$ we can write $$a=\prod_n p_n^{\alpha_n} ,b=\prod_n p_n^{\beta_n},$$ where $\{p_n \}$ is the increasing sequence of primes.
Now, $$gcd(a,b)=lcm(a,b) \Leftrightarrow \prod_n p_n^{\min(\alpha_n,\beta_n)}=\prod_n p_n^{\max(\alpha_n,\beta_n)} \Leftrightarrow \forall n \; \alpha_n=\beta_n \Leftrightarrow a=b.$$