Minimum possible value of $f(2007)$ where $f(m f(n)) = n f(m)$, $m,n\in \Bbb N$ If $f$ is from positive integers to positive integers and satisfies
$f(m f(n)) = n f(m)$ then find the minimum possible value of $f(2007)$.
My work so far:


*

*$f(1) = 1$ . Proof:



Suppose $f(1) = k \neq 1$.  Then consider $f(f(2)) = 2f(1) = 2k$.
  $f(2) = f(2f(1)) = f(2k),$ $f(f(2)) = 2k,$ but the above also implies
  that $f(f(2)) = f(f(2k)) = 2k^2$, a contradiction. Thus $f(1) = 1$



*

*I further found that if $f(a) = b$, then $f(a^x b^y) = a^y b^x$. 

 A: Let $a=f(1)\neq 0$. 


*

*Putting $m=1$ we get $f(f(n)) =an$ so $f$ is injective. 

*For $n=1$ we get $f(ma) = f(m)$ so we have $ma=m$ so $a=1$ and thus $f(f(n)) =n$.


If we put $n=f(k)$ we get $f(mk)=f(k)f(m)$ so $f$ is multiplicative.  Each such function is uniqely determined by the pictures of primes. We have $$f(2007) = f(3)^2f(223)$$
$f(3)=p$ and $f(223)=q$ are primes. Since $$f(p)=f(f(3))=3$$ and $$f(q)=f(f(223))=223$$ the minimum will be if we take $p=3$ and $q=2$.
so the answer is $18$?
A: You've already shown that $f(1)=1$. Plugging in $m=1$ it then follows that $f(f(n))=n$ for all $n$. In particular $f$ is bijective. Now for arbitrary $m$ and $n$, setting $k:=f(n)$ we see that $f(k)=f(f(n))$ and so
$$\forall m,n:\ f(mf(n))=nf(m)\qquad\Leftrightarrow\qquad \forall k,m:\ f(km)=f(k)f(m),$$
which shows that $f$ is completely multiplicative. In particular this means that $f(2007)=f(3^2)f(223)$ because $2007=3^2\times223$.
Now let $p$ be any prime number, and suppose $f(p)=ab$ for positive integers $a$ and $b$. Then
$$p=f(f(p))=f(ab)=f(a)f(b),$$
so without loss of generality $f(a)=1$. Then $a=f(f(a))=f(1)=1$ and so $f(p)$ is also prime. This means that $f$ permutes the set of primes. Because $f(f(p))=p$ for all primes this means $f$ is determined entirely by a permutation of order $2$ of the set of prime numbers.
I leave it to you to verify that conversely, every permutation of order $2$ of the set of prime numbers determines a completely multiplicative function that satisfies the functional equation. From there it is easy to verify that the minimum value of $f(2007)$ is $2\times3^2=18$.
