Find all functions $f : Z \to Z$ for which $f(g(n)) - g(f(n))$ is independent on $n$ for any $g : Z \to Z$.
1. **Define the assertion:**
   Let \( P(g(n)) \) be the assertion that \( f(g(n)) - g(f(n)) \) is independent of \( n \) for any function \( g : \mathbb{Z} \to \mathbb{Z} \).

2. **Consider the function \( g(n) = n+1 \):**
   \[
   P(n+1) \implies f(n+1) - (n+1) = f(n) - n
   \]
   This implies:
   \[
   f(n+1) - f(n) = 1
   \]
   Therefore, \( f(n) \) is an arithmetic sequence with a common difference of 1. Hence, we can write:
   \[
   f(n) = n + c
   \]
   for some constant \( c \in \mathbb{Z} \).

3. **Consider the function \( g(n) = n^2 \):**
   \[
   P(n^2) \implies f(n^2) - (n^2) = f(n) - n
   \]
   Substituting \( f(n) = n + c \) into the equation:
   \[
   f(n^2) = n^2 + c
   \]
   Thus:
   \[
   n^2 + c - n^2 = n + c - n
   \]
   Simplifying, we get:
   \[
   c = c
   \]
   This is always true and does not provide any new information.

4. **Check for other possible forms of \( f(n) \):**
   Suppose \( f(n) = an + b \) for some \( a, b \in \mathbb{Z} \). Then:
   \[
   f(g(n)) = a g(n) + b
   \]
   and:
   \[
   g(f(n)) = g(an + b)
   \]
   The assertion \( f(g(n)) - g(f(n)) \) being independent of \( n \) implies:
   \[
   a g(n) + b - g(an + b) = k
   \]
   for some constant \( k \in \mathbb{Z} \).

5. **Consider specific forms of \( g(n) \):**
   - For \( g(n) = n \):
     \[
     a n + b - g(an + b) = k \implies a n + b - (an + b) = k \implies 0 = k
     \]
     This implies \( k = 0 \).

   - For \( g(n) = n^2 \):
     \[
     a n^2 + b - g(an + b) = 0 \implies a n^2 + b - (an + b)^2 = 0
     \]
     Expanding \( (an + b)^2 \):
     \[
     a n^2 + b - (a^2 n^2 + 2abn + b^2) = 0 \implies a n^2 + b - a^2 n^2 - 2abn - b^2 = 0
     \]
     Equating coefficients, we get:
     \[
     a - a^2 = 0 \implies a(a - 1) = 0 \implies a \in \{0, 1\}
     \]
     and:
     \[
     b - b^2 = 0 \implies b(b - 1) = 0 \implies b \in \{0, 1\}
     \]

6. **Analyze the cases for \( a \) and \( b \):**
   - If \( a = 0 \), then \( f(n) = b \). Since \( f(n) \) must be a constant function, \( f(n) = c \) for some constant \( c \in \mathbb{Z} \).
   - If \( a = 1 \), then \( f(n) = n + b \). Since \( f(n) \) must be linear, \( f(n) = n \) or \( f(n) = n + 1 \).

   However, \( f(n) = n + 1 \) does not satisfy the condition for all \( g(n) \). Therefore, the only valid solutions are \( f(n) = n \) and \( f(n) = c \).

The final answer is \( \boxed{f(x) = x} \) and \( \boxed{f(x) = c} \).