TITLE: Does there exist a function such that $f(a)f(b)=f(a^2b^2)?$
QUESTION [8 upvotes]: Given $S=\{2,3,4,5,6,7,\cdots,n,\cdots,\} = \Bbb N_{>1}$, prove whether there exists a function $f:S\to S$, such that for any positive $a,b$:
  $$f(a)f(b)=f(a^2b^2),a\neq b?$$

This is 2015 APMO problem 2 (this event ended yesterday: see APMO), maybe I think didn't exist such a function, but I can't prove it.

My attempt:
Consider $p_{i}$ is $i^{th}$ prime,such $f(2)=2^2,f(3)=5^2,f(5)=11^2,\cdots?$

REPLY [2 votes]: The existing answer by Michael is a nice first proof, but I feel it's quite a deus ex machina.
Therefore, let me sketch an approach to solve the general situation, providing more insight.

So suppose that for all $a \ne b$, we have: $$f(a^nb^n) = f(a)f(b)$$
Then in particular, for all $a,b,c,d$, $a \ne b,c \ne d$:
$$a^nb^n = c^nd^n \implies f(a)f(b) = f(c)f(d)$$
Rewriting and using that $n$th powers are injective on the natural numbers:
$$\frac ac = \frac db \leadsto ab = cd \leadsto f(a)f(b) = f(c)f(d) \leadsto \frac{f(a)}{f(c)} = \frac{f(d)}{f(b)}$$
In particular, for any $x,y \ge 2$:
$$\frac{ax}x = \frac{ay}y \leadsto \frac{f(ax)}{f(x)} = \frac{f(ay)}{f(y)}$$
That is, there exists some $\lambda_a$ such that for all $x$, $f(ax) = \lambda_a f(x)$.
Because $a,x,y$ were completely arbitrary, we can derive inductively from $$f(aa^n) = \lambda_a f(a^n) = \lambda_{a^n}f(a)$$ that $\lambda_{a^n} = \lambda_a^n$. From here on, we can apply the following basic algebra:
\begin{align*}
f(a^{3n}) &= \lambda_a^{3n-1} f(a) = f(a)f(a^2) = \lambda_a f(a)^2 \leadsto f(a) = \lambda_a^{3n-2}\\
f(a^{4n}) &= \lambda_a^{4n-1} f(a) = f(a)f(a^3) = \lambda_a^2 f(a)^2 \leadsto f(a) = \lambda_a^{4n-3}
\end{align*}
Hence, $\lambda_a^{n-1} = \frac{f(a)}{f(a)} = 1$, and we conclude that:
$$f(a) = \lambda_a^{3n-2} = \lambda_a (\lambda_a^{n-1})^3 = \lambda_a$$
which contradicts that $f(a) \in \Bbb N_{>1}$. Therefore, such an $f$ cannot exist.

I came to this approach by writing down the conditions on values of the form $f(a^2b^2)$ and recognising that this was reminiscent of the construction of the rational numbers.