I've recently ran an into interesting functional equation and I would be grateful for everyone that could provide me with a hint/advice. Let $d_1,d_2,\ldots,d_k$ denote all divisors of positive integer $n$, find all functions $f:\mathbb{N}\to\mathbb{N}$ such that$$\prod_{i=1}^{k}f(d_i)=n.\tag{1}$$ I suspect that the only function that could satisfy this would be: For $x$ being a perfect power of a prime number $p$, $f(x)=p$, otherwise $f(x)=1$. Clearly $f(1)=1$, hence $f(2)f(1)=2\Longrightarrow f(2)=2$, thus $f(1)f(3)=3\Longrightarrow f(3)=3$. And $f(1)f(2)f(4)=4$, so $f(4)=2$, and $f(8)=f(1)f(2)f(4)f(8)$, so again $f(8)=f(2^3)=2$. Then we have $f(1)f(2)f(3)f(9)=9$ and thus $f(9)=3$ and we can go on with this procedure. For another example $f(1)f(2)f(3)f(4)f(6)f(8)f(12)f(24)=24$. We can easily conlude that $f(12)=1$, so again $f(24)=1$, because $f(2)f(3)f(4)f(8)=3\cdot2^3=24$.
This function is practically turning the product on the left hand side of (1) into prime factorization of number $n$.
How to prove that this is the only function? Only approach I can think of is induction (which could be some improvement of approach shown before) or are there another such a functions?
Thanks a lot!