Solution:
Each positive integer can be uniquely written as n=2kl where k⩾0 and l is odd. We will show that the only function satisfying the conditions is f(2kl)=k+1 for all k⩾0 and all odd l.
Assume that f(1)=1. Since f is surjective, there exists a∈N such that f(a)=1. Since f(1)=1=f(a), we get f(a+1)=min{f(a),f(1)}=1, and inductively we get f(n)=1 for each n⩾a. However, this contradicts the surjectivity of f.
Therefore f(1)=1. Then f(2)=min{f(1),f(1)}=1, and f(3)=min{f(1),f(2)}=1. Now it easily follows by induction that f(n)=1 if n is odd and f(n)>1 if n is even.
We will show by induction on k that f(2kl)=k+1 for all odd l and f(2km)>k+1 for all even m. The basis of induction has been proved above. Assume that the statement holds for all k<k0. We define new function g:N→N by g(n)=f(2k0n)−k0. By induction hypothesis g indeed maps to N. In addition, on the set of all integers not divisible by 2k0, the values of f are smaller than k0+1. Values greater or equal to k0+1 are thus attained by f on the set of integers divisible by 2k0, making g surjective. A straightforward verification shows that g also satisfies the remaining condition of the initial problem. So g(n)=1 if n is odd and g(n)>1 if n is even, as we have shown above. Therefore f(2k0l)=k0+1 for odd l and f(2k0m)>k0+1 for even m, which completes the induction. It is easy to check that this function indeed satisfies the conditions of the problem.
Like in Solution 1 we prove that
f( odd )=1, and f( even )>1
We will show by induction on k that f(2kl)=k+1 for all odd l and f(2km)>k+1 for all even m. The basis of induction has been proved above. Assume that the statement holds for all k<k0. Induction step is proved similarly as above. Suppose f(2k0)=k0+1, meaning that f(2k0)>k0+1. Surjectivity of f implies, that there exists positive integer b such that f(b)=k0+1. By induction hypothesis b is of the form b=2k0r for some r (r may be odd or even). Considering the pair (2k0,b) we get f(2k0(r+1))=f(b+2k0)=min{f(2k0),f(b)}=k0+1. By induction we get f(2k0r′)=k0+1 for all r′⩾r, contradicting the surjectivity of f. Hence f(2k0)=k0+1. Conditions of the problem and induction hypothesis imply that f(n)=k0+1 iff f(n+2k0)>k0+1. Therefore it follows inductively that f(2k0l)=k0+1 for odd l and f(2k0m)>k0+1 for even m, which finishes the induction step.
It is easy to check that the function defined by f(2k0l)=k0+1 for odd l indeed satisfies the conditions of the problem.