Let $\mathbb{N}=\{1,2,\ldots\}$. Find all functions $f: \mathbb{N}\to\mathbb{N}$ such that for all $m,n\in \mathbb{N}$ the number $f^2(m)+f(n)$ is  a divisor of $(m^2+n)^2$.
To find all functions \( f: \mathbb{N} \to \mathbb{N} \) such that for all \( m, n \in \mathbb{N} \), the number \( f^2(m) + f(n) \) is a divisor of \( (m^2 + n)^2 \), we proceed as follows:

1. **Initial Condition Analysis:**
   Consider \( m = n = 1 \):
   \[
   f^2(1) + f(1) \mid (1^2 + 1)^2 = 4
   \]
   The divisors of 4 are 1, 2, and 4. Therefore, \( f(1) \) must satisfy:
   \[
   f^2(1) + f(1) \in \{1, 2, 4\}
   \]
   Testing these values:
   - If \( f(1) = 1 \):
     \[
     f^2(1) + f(1) = 1^2 + 1 = 2 \quad (\text{valid})
     \]
   - If \( f(1) = 2 \):
     \[
     f^2(1) + f(1) = 2^2 + 2 = 6 \quad (\text{not a divisor of 4})
     \]
   - If \( f(1) = 4 \):
     \[
     f^2(1) + f(1) = 4^2 + 4 = 20 \quad (\text{not a divisor of 4})
     \]
   Therefore, \( f(1) = 1 \).

2. **General Case Analysis:**
   Let \( p \) be a large prime number. Consider \( m = 1 \) and \( n = p-1 \):
   \[
   f^2(1) + f(p-1) \mid (1^2 + (p-1))^2 = p^2
   \]
   Since \( f(1) = 1 \):
   \[
   1 + f(p-1) \mid p^2
   \]
   The possible values for \( 1 + f(p-1) \) are divisors of \( p^2 \), which are \( 1, p, p^2 \). Since \( f(p-1) \in \mathbb{N} \), we have:
   \[
   1 + f(p-1) = p \quad \text{or} \quad 1 + f(p-1) = p^2
   \]
   - If \( 1 + f(p-1) = p \):
     \[
     f(p-1) = p - 1
     \]
   - If \( 1 + f(p-1) = p^2 \):
     \[
     f(p-1) = p^2 - 1 \quad (\text{not possible since } f(p-1) \in \mathbb{N})
     \]

3. **Verification for General \( m \):**
   Assume \( f(m) = m \) for all \( m \in \mathbb{N} \). We need to verify:
   \[
   f^2(m) + f(n) = m^2 + n \mid (m^2 + n)^2
   \]
   Clearly, \( m^2 + n \) divides \( (m^2 + n)^2 \).

4. **Uniqueness:**
   Suppose there exists another function \( g \neq f \) that satisfies the condition. Then there must exist some \( k \in \mathbb{N} \) such that \( g(k) \neq k \). However, the same analysis as above would lead to a contradiction, confirming that \( f(m) = m \) is the only solution.

\(\blacksquare\)

The final answer is \( \boxed{ f(m) = m } \) for all \( m \in \mathbb{N} \).