Find all surjective functions $f:\mathbb{N}\to\mathbb{N}$ such that for all positive integers $a$ and $b$, exactly one of the following equations is true:
\begin{align*}
f(a)&=f(b), <br /> \\
 f(a+b)&=\min\{f(a),f(b)\}.
\end{align*}
[i]Remarks:[/i] $\mathbb{N}$ denotes the set of all positive integers. A function $f:X\to Y$ is said to be surjective if for every $y\in Y$ there exists $x\in X$ such that $f(x)=y$.
1. **Define Sets and Base Case:**
   For \( n \in \mathbb{N} \), define the sets \( A_n = \{ x \in \mathbb{N} \mid f(x) = n \} \) and \( B_n = \{ x \in \mathbb{N} \mid \nu_2(x) + 1 = n \} \). We aim to prove by induction that \( A_n = B_n \) for all \( n \in \mathbb{N} \).

2. **Base Case \( n = 1 \):**
   - Assume \( f(1) = a \neq 1 \). Then \( 1 \in A_a \).
   - Consider \( A_{a-1} \). By surjectivity, \( A_{a-1} \) is nonempty. Let \( x \in A_{a-1} \).
   - Since \( f(x) = f(1) \iff a-1 = a \) does not hold, we must have \( f(x+1) = \min\{ f(x), f(1) \} = \min\{ a-1, a \} = a-1 \).
   - Therefore, \( x \in A_{a-1} \implies x+1 \in A_{a-1} \). Continuing this process, all numbers from \( x \) onwards map to \( a-1 \), contradicting the surjectivity of \( f \). Hence, \( a = 1 \) must hold.

3. **Implications of \( f(1) = 1 \):**
   - For any \( x \in \mathbb{N} \), \( f(x) = 1 = f(1) \implies f(x+1) \neq \min\{ f(x), f(1) \} = 1 \). Thus, \( x \in A_1 \implies x+1 \not\in A_1 \).
   - Conversely, if \( f(x) \neq 1 = f(1) \), we must have \( f(x+1) = \min\{ f(x), f(1) \} = \min\{ f(x), 1 \} = 1 \). Hence, \( x \not\in A_1 \implies x+1 \in A_1 \).

4. **Conclusion for \( A_1 \):**
   - The elements of \( \mathbb{N} \) alternately occur and do not occur in \( A_1 \). Since \( 1 \) occurs in \( A_1 \), all odd numbers are in \( A_1 \), and none of the even numbers are in \( A_1 \). Thus, \( A_1 = B_1 \).

5. **Induction Hypothesis:**
   - Suppose \( A_1 = B_1, \ldots, A_m = B_m \) have been proved. The numbers in \( \mathbb{N} \) not in any \( A_i \) for \( 1 \leq i \leq m \) are those divisible by \( 2^m \).

6. **Define Function \( g \):**
   - Define \( g(n) = f(2^m n) - m \). This is valid because \( 2^m n \not\in B_i \) for any \( 1 \leq i \leq m \), so \( f(2^m n) > m \).
   - \( g \) is surjective since \( f \) takes all integer values \( > m \) for arguments divisible by \( 2^m \).
   - For any \( (a, b) \in \mathbb{N}^2 \), exactly one of \( g(a) = g(b) \) or \( g(a+b) = \min\{ g(a), g(b) \} \) holds.

7. **Induction Step:**
   - By the same analysis as the base case, \( g(n) = 1 \iff n \) is odd, i.e., \( f(n) = m+1 \iff \nu_2(n) = m \). Thus, \( A_{m+1} = B_{m+1} \), completing the induction step.

8. **Conclusion:**
   - The result implies \( f(n) = \nu_2(n) + 1 \), which satisfies the given conditions.

\(\blacksquare\)

The final answer is \( \boxed{ f(n) = \nu_2(n) + 1 } \)