Let $f \in \mathbb Z[X]$. For an $n \in \mathbb N$, $n \geq 2$, we define $f_n : \mathbb Z / n \mathbb Z \to \mathbb Z / n \mathbb Z$ through $f_n \left( \widehat x \right) = \widehat{f \left( x \right)}$, for all $x \in \mathbb Z$.

(a) Prove that $f_n$ is well defined.

(b) Find all polynomials $f \in \mathbb Z[X]$ such that for all $n \in \mathbb N$, $n \geq 2$, the function $f_n$ is surjective.

[i]Bogdan Enescu[/i]
### Part (a)
1. We need to show that \( f_n \) is well-defined. This means that if \( \widehat{x} = \widehat{y} \) in \( \mathbb{Z}/n\mathbb{Z} \), then \( f_n(\widehat{x}) = f_n(\widehat{y}) \).
2. By definition, \( \widehat{x} = \widehat{y} \) implies \( x \equiv y \pmod{n} \), which means \( n \mid (x - y) \).
3. We need to show that \( \widehat{f(x)} = \widehat{f(y)} \). This is equivalent to showing that \( f(x) \equiv f(y) \pmod{n} \).
4. Since \( f \in \mathbb{Z}[X] \), \( f(x) \) is a polynomial with integer coefficients. Therefore, \( f(x) - f(y) \) can be written as:
   \[
   f(x) - f(y) = a_k(x^k - y^k) + a_{k-1}(x^{k-1} - y^{k-1}) + \cdots + a_1(x - y)
   \]
5. Each term \( x^i - y^i \) for \( i \geq 1 \) is divisible by \( x - y \). Since \( n \mid (x - y) \), it follows that \( n \mid (x^i - y^i) \) for all \( i \geq 1 \).
6. Therefore, \( n \mid (f(x) - f(y)) \), which implies \( f(x) \equiv f(y) \pmod{n} \).
7. Hence, \( \widehat{f(x)} = \widehat{f(y)} \), and \( f_n(\widehat{x}) = f_n(\widehat{y}) \). This shows that \( f_n \) is well-defined.

### Part (b)
1. We need to find all polynomials \( f \in \mathbb{Z}[X] \) such that for all \( n \in \mathbb{N} \), \( n \geq 2 \), the function \( f_n \) is surjective.
2. Suppose \( \deg(f) \geq 2 \). We will show that \( f_n \) cannot be surjective for some \( n \).
3. Choose an integer \( x_0 \) such that \( M = |f(x_0) - f(0)| > |x_0| \).
4. Consider \( n = M \). In \( \mathbb{Z}/M\mathbb{Z} \), we have:
   \[
   f_M(\widehat{0}) = \widehat{f(0)} \quad \text{and} \quad f_M(\widehat{x_0}) = \widehat{f(x_0)}
   \]
5. Since \( M = |f(x_0) - f(0)| \), we have \( \widehat{f(x_0)} = \widehat{f(0)} \) in \( \mathbb{Z}/M\mathbb{Z} \).
6. This implies \( f_M(\widehat{0}) = f_M(\widehat{x_0}) \), but \( \widehat{x_0} \neq \widehat{0} \) in \( \mathbb{Z}/M\mathbb{Z} \).
7. Since \( \mathbb{Z}/M\mathbb{Z} \) is finite, for \( f_M \) to be surjective, it must be injective. However, we have found \( \widehat{0} \neq \widehat{x_0} \) such that \( f_M(\widehat{0}) = f_M(\widehat{x_0}) \), which is a contradiction.
8. Therefore, \( \deg(f) \leq 1 \).
9. Let \( f(X) = aX + b \). We need to check the conditions for \( f_n \) to be surjective.
10. If \( a = 0 \), then \( f(X) = b \), and \( f_n(\widehat{x}) = \widehat{b} \) for all \( \widehat{x} \in \mathbb{Z}/n\mathbb{Z} \). This is not surjective for \( n \geq 2 \).
11. If \( |a| > 1 \), consider \( n = |a| \). In \( \mathbb{Z}/|a|\mathbb{Z} \), we have \( f_n(\widehat{x}) = \widehat{ax + b} = \widehat{b} \) for all \( \widehat{x} \in \mathbb{Z}/|a|\mathbb{Z} \). This is not surjective.
12. Therefore, \( |a| = 1 \). Hence, \( f(X) = \pm X + b \) with \( b \in \mathbb{Z} \).
13. It is easy to check that these polynomials satisfy the hypothesis, as \( f_n(\widehat{x}) = \widehat{\pm x + b} \) is surjective for all \( n \geq 2 \).

The final answer is \( \boxed{ f(X) = \pm X + b } \) with \( b \in \mathbb{Z} \).