Determine all functions $f$ from the set of non-negative integers to itself such that $f(a + b) = f(a) + f(b) + f(c) + f(d)$, whenever $a, b, c, d$, are non-negative integers satisfying $2ab = c^2 + d^2$.
1. **Lemma:** For every positive integer \( n \geq 2 \), there are positive integers \( a \) and \( b \) with \( a + b = n \) for which there are nonnegative integers \( c \) and \( d \) such that \( 2ab = c^2 + d^2 \).

   **Proof:** From Lagrange's Four Square Theorem, we know that any positive integer \( n \) can be expressed as the sum of four squares, i.e., there exist nonnegative integers \( x, y, z, t \) such that \( n = x^2 + y^2 + z^2 + t^2 \).

   - If \( n \) is not a perfect square, at least two of \( x, y, z, t \) are positive. Assume \( x, y > 0 \). Let \( a = x^2 + z^2 \) and \( b = y^2 + t^2 \). Then we can consider \( c = |xy - zt + xt + yz| \) and \( d = |xy - zt - xt - yz| \). It can be verified that \( 2ab = c^2 + d^2 \).
   
   - If \( n \) is a perfect square, let \( p \) be a prime divisor of \( n \). Take \( a = pa' \), \( b = pb' \), \( c = pc' \), \( d = pd' \) where \( 2a'b' = c'^2 + d'^2 \) and \( a' + b' = \frac{n}{p} \) (which is not a perfect square). This construction ensures that \( 2ab = c^2 + d^2 \).

2. **Induction Hypothesis:** We will prove by strong induction that \( f(n) = n^2 f(1) \) for all nonnegative integers \( n \).

   - **Base Case:** For \( n = 0 \), we have \( f(0) = 0 \) since \( f(a + b) = f(a) + f(b) + f(c) + f(d) \) with \( a = b = c = d = 0 \) implies \( f(0) = 4f(0) \), hence \( f(0) = 0 \).

   - **Induction Step:** Assume that for all \( k < n \), \( f(k) = k^2 f(1) \). We need to show that \( f(n) = n^2 f(1) \).

     From the lemma, we have \( a, b, c, d < n \) such that \( 2ab = c^2 + d^2 \) and \( a + b = n \). By the induction hypothesis, we have:
     \[
     f(a) = a^2 f(1), \quad f(b) = b^2 f(1), \quad f(c) = c^2 f(1), \quad f(d) = d^2 f(1)
     \]
     Using the given functional equation \( f(a + b) = f(a) + f(b) + f(c) + f(d) \), we get:
     \[
     f(n) = f(a + b) = f(a) + f(b) + f(c) + f(d)
     \]
     Substituting the values from the induction hypothesis:
     \[
     f(n) = a^2 f(1) + b^2 f(1) + c^2 f(1) + d^2 f(1)
     \]
     Since \( 2ab = c^2 + d^2 \), we have:
     \[
     f(n) = a^2 f(1) + b^2 f(1) + 2ab f(1) = (a^2 + b^2 + 2ab) f(1) = (a + b)^2 f(1) = n^2 f(1)
     \]
     Thus, \( f(n) = n^2 f(1) \).

By induction, we have shown that \( f(n) = n^2 f(1) \) for all nonnegative integers \( n \).

The final answer is \( \boxed{ f(n) = n^2 f(1) } \).