1Let $P = \prod_{d \mid n} d$. Pair each divisor $d$ with its complement $n/d$, which is also a divisor; as $d$ ranges over all divisors, so does $n/d$.
2Multiply the two listings: $P \cdot P = \prod_{d \mid n} d \cdot \prod_{d \mid n} \frac{n}{d} = \prod_{d \mid n}\left(d \cdot \frac{n}{d}\right) = \prod_{d \mid n} n = n^{\tau(n)}$.
3Therefore $P^2 = n^{\tau(n)}$, so $P = n^{\tau(n)/2}$ (taking the positive root, valid since $P > 0$).
4The exponent $\tau(n)/2$ is an integer when $\tau(n)$ is even; when $\tau(n)$ is odd ($n$ a perfect square), the unpaired middle divisor is $\sqrt n$, and $n^{\tau(n)/2} = (\sqrt n)^{\tau(n)}$ is still an integer, so the formula holds in all cases. (Check $n = 12$: divisors $1,2,3,4,6,12$ multiply to $1728 = 12^3 = 12^{6/2}$. ✓)