Let $a$, $b$ be two positive integers. Prove that $a$ and $b$ are both perfect squares if and only if both $\gcd(a,b)$ and $\operatorname{lcm}(a,b)$ are perfect squares.
I believe the proof is based in prime factorization, as if $a$ is a perfect square, then $a = (p_1^{a_1}\cdot\ldots\cdot p_n^{a_n})^2$, and the same goes for the gcd and lcm when they are perfect squares. I'm just a little lost on how to connect the dots and prove both directions.
The crux of the matter is: $m$ and $n$ are both even if and only if both $\min(m, n)$ and $\max(m,n)$ are both even.
(That's obvious, isn't it. If they are both even then the min and the max are one or the other of them and will have to be even. And if the min and max are both even, each one is either the min or the max and the other will be the other extreme and they will both be even.
===
Let $\{p_i\}$ be all the prime factors of either $a$ or $b$.
We can write $a = \prod p_i^{m_i}$. If it turns out that $p_k\not \mid a$ but $p_k\mid b$ this will be okay if we assume we can let $m_k = 0$. And we can write $b = \prod p_i ^{n_i}$ (same caveat.)
Now $G=\gcd(a,b) = \prod p_i^{\min(m_i,n_i)}$ and $L=\operatorname{lcm}=\prod p_i^{\max(m_i,n_1)}$.
Now any one of those is a perfect square if and only if all the powers are even (and $0$ is an even number and $1$ is a perfect square so any concerns we have about what if $p_k$ divides one but not the other are addresses).
So.....
If $a$ and $b$ are both perfect squares then $m_i, n_i$ will all be even so $\min(m_i, n_i)$ and $\max(m_i, n_i)$ will all be even. So $G=\gcd(a,b)$ and $L =\operatorname{lcm}(a,b)$ will both be perfect squares.
And if $G=\gcd(a,b)$ and $L =\operatorname{lcm}(a,b)$ are both perfect squares then $\min(m_i, n_i)$ and $\max(m_i,n_i)$ are all even. SO all $m_i, n_i$ are even, so $a$ and $b$ are both perfect squares.
We can even argue further (although we don't have to-- we are totally done!) that if either $a$ or $b$ aren't both perfect squares there will be at least one $m_i$ or at least one $n_i$ that is odd and that is true if and only if at least one $\max(m_i,n_i)$ or one $\min(m_i,n_i)$ that is odd, so at least one of $G=\gcd(a,b)$ and $L =\operatorname{lcm}(a,b)$ are not a perfect square.
======
The crux of the matter is: $m$ and $n$ are both even if and only if both $\min(m, n)$ and $\max(m,n)$ are both even.