Find all functions $f : \mathbb{N} \to \mathbb{N}$ satisfying the following conditions:
[list]
[*]For every $n \in \mathbb{N}$, $f^{(n)}(n) = n$. (Here $f^{(1)} = f$ and $f^{(k)} = f^{(k-1)} \circ f$.)
[*]For every $m, n \in \mathbb{N}$, $\lvert f(mn) - f(m) f(n) \rvert < 2017$.
[/list]

1. **Understanding the Conditions:**
   - The first condition states that for every \( n \in \mathbb{N} \), \( f^{(n)}(n) = n \). This implies that applying the function \( f \) \( n \) times to \( n \) returns \( n \).
   - The second condition states that for every \( m, n \in \mathbb{N} \), \( |f(mn) - f(m) f(n)| < 2017 \). This implies that the difference between \( f(mn) \) and the product \( f(m) f(n) \) is less than 2017.

2. **Establishing Multiplicativity:**
   - Assume there exists \( n \ge 1 \) and \( m \) such that \( f(mn) \ne f(m) f(n) \).
   - Consider the inequality:
     \[
     f(k) \le |f(mn)f(k) - f(m)f(n)f(k)| \le |f(mnk) - f(m)f(n)f(k)| + |f(mnk) - f(mn)f(k)|
     \]
   - This can be further broken down as:
     \[
     |f(mnk) - f(m)f(n)f(k)| \le |f(mnk) - f(mk)f(n)| + |f(mk)f(n) - f(m)f(n)f(k)|
     \]
   - Combining these inequalities, we get:
     \[
     f(k) \le 2017 \cdot (2 + f(n))
     \]
   - Since \( f \) is surjective (from the first condition), it cannot be bounded above, leading to a contradiction. Hence, \( f(mn) = f(m) f(n) \) for all \( m, n \in \mathbb{N} \).

3. **Injectivity:**
   - Suppose \( f(a) = f(b) = c \). Then:
     \[
     a = f^c(a) = f^c(b) = b
     \]
   - This shows that \( f \) is injective.

4. **Behavior on Primes:**
   - For a prime \( p \), using the first condition:
     \[
     f^{1+f(p)}(p) = f(p) \implies f^{f(p)}(p) = p
     \]
   - Let \( d \) be the order of \( p \) under composition of \( f \). Then \( d \mid \gcd(p, f(p)) \).
   - If \( d = 1 \), then \( f(p) = p \). Otherwise, \( p \mid f(p) \).

5. **Conclusion:**
   - From multiplicativity, \( n \mid f(n) \). For primes \( p \), \( f(p) = p \).
   - By induction and multiplicativity, \( f(n) = n \) for all \( n \in \mathbb{N} \).

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