If each exponent is even then you can write
If n is a perfect square, then
Now t has its own unique factorization into primes. By the Fundamental Theorem of Arithmetic, the primes and their exponents must be equal on both sides of the equation. Since the exponents of all the primes on the right are even after you square, all the exponents on the left must be even also.
Does this help? Let me know if something is unclear.