Here is a proof using Pigeonhole Principle (although my explanation is quite bad). Any critique is much appreciated.
Let $n \geq 2$. $\forall \ I \subseteq \{1,2,...,n\}, $ write $\prod_{i \in I} a_i$ in the form $p_1^{\alpha_1}p_2^{\alpha_2}...p_k^{\alpha_k}, k \leq n-1, \alpha_i \geq 0. $
For each $I$, consider the induced $k$-tuple $(\alpha_1,\alpha_2,...,\alpha_k)$ modulo $2$. There are at most $2^{n-1}$ distinct such tuples (Each $\alpha_i$ is $0$ or $1$ modulo $2$). Additionally, there are $2^n-1$ subsets of $\{1,2,...,n\}$, excluding the null set.
Since $2^n-1 > 2^{n-1}, $ by the Pigeonhole Principle, there are $2$ distinct subsets, $I_1$ and $I_2$, of $\{1,2,...,n\}$, such that $(\alpha_1,\alpha_2,...,\alpha_k) = (\beta_1,\beta_2,...,\beta_k)$ modulo $2$. We now consider $2$ cases :
Case $1$: $I_1$ and $I_2$ are disjoint. Clearly, $\prod_{i \in {I_1 \cup I_2}} a_i =p_1^{\alpha_1+\beta_1}p_2^{\alpha_2+\beta_2}...p_k^{\alpha_k+\beta_k}$ is a perfect square, since each exponent $\alpha_{i} + \beta_{i}$ is even.
Case $2$: $I_1$ and $I_2$ are not disjoint, but $I_1$ is not a subset of $I_2$, and vice versa. Let $m$ be a common element, and consider the $2$ new sets $J_1=I_1\setminus \{m\},J_2=I_2\setminus \{m\}$. Clearly, the $2$ new induced tuples $(\alpha_1^{'},\alpha_2^{'},...,\alpha_k^{'})$ and $(\beta_1^{'},\beta_2^{'},...,\beta_k^{'})$ are still equal modulo $2$. If $J_1$ and $J_2$ are disjoint, we are done by Case $1$. Otherwise, we iterate this process until we end up with $2$ disjoint subsets, then apply Case $1$.
Case $3$: $I_1$ is a (strict) subset of $I_2$, or vice versa. W.L.O.G. let it be the latter. Then, consider $\prod_{i \in {I_1 \setminus I_2}} a_i =p_1^{\alpha_1-\beta_1}p_2^{\alpha_2-\beta_2}...p_k^{\alpha_k-\beta_k}$, which is a perfect square since each exponent is a non-negative even integer.
Best Answer
IMO 1997, Problem B2
Find all pairs $(a, b)$ of positive integers that satisfy $a^{b^2} = b^a$.
Answer
$(1,1)$, $(16,2)$, $(27,3)$.
Solution
Notice first that if we have $a^m = b^n$, then we must have $a = c^e$, $b = c^f$, for some $c$, where $m=fd$, $n=ed$ and $d$ is the greatest common divisor of $m$ and $n$.
[Proof: express $a$ and $b$ as products of primes in the usual way.]
In this case let $d$ be the greatest common divisor of $a$ and $b^2$, and put $a = de$, $b^2 = df$. Then for some $c$, $a = ce$, $b = cf$. Hence $f c^e = e c^{2f}$. We cannot have $e = 2f$, for then the $c$'s cancel to give $e = f$. Contradiction.
Suppose $2f > e$, then $f = e c^{2f-e}$. Hence $e = 1$ and $f = c^{2f-1}$. If $c = 1$, then $f = 1$ and we have the solution $a = b = 1$. If $c ≥ 2$, then $c^{2f-1} ≥ 2^f > f$, so there are no solutions.
Finally, suppose $2f < e$. Then $e = f c^{e-2f}$. Hence $f = 1$ and $e = c^{e-2}$. $c^{e-2} ≥ 2^{e-2} ≥ e$ for $e ≥ 5$, so we must have $e = 3$ or $4$ ($e > 2f = 2$). $e = 3$ gives the solution $a = 27$, $b = 3$. $e = 4$ gives the solution $a = 16$, $b = 2$.
P.S. Since the website I referred to in the comment above has been moved in the past, I don't know how permanent this link will be. So I quoted the solution here.