Determine all functions $ f$ defined in the set of rational numbers and taking their values in the same set such that the equation $ f(x + y) + f(x - y) = 2f(x) + 2f(y)$ holds for all rational numbers $x$ and $y$.
1. **Define the assertion**: Let \( P(x, y) \) be the assertion \( f(x + y) + f(x - y) = 2f(x) + 2f(y) \).

2. **Evaluate \( P(0, 0) \)**:
   \[
   P(0, 0) \implies f(0 + 0) + f(0 - 0) = 2f(0) + 2f(0) \implies 2f(0) = 4f(0) \implies f(0) = 0
   \]

3. **Evaluate \( P(x, 0) \)**:
   \[
   P(x, 0) \implies f(x + 0) + f(x - 0) = 2f(x) + 2f(0) \implies f(x) + f(x) = 2f(x) + 0 \implies 2f(x) = 2f(x)
   \]
   This equation is always true and does not provide new information.

4. **Evaluate \( P(x, x) \)**:
   \[
   P(x, x) \implies f(x + x) + f(x - x) = 2f(x) + 2f(x) \implies f(2x) + f(0) = 4f(x) \implies f(2x) = 4f(x)
   \]

5. **Induction on \( n \)**:
   - For \( n = 1 \), we have \( f(x) = f(x) \), which is trivially true.
   - Assume \( f(nx) = n^2 f(x) \) holds for some \( n \in \mathbb{N} \).
   - Evaluate \( P(nx, x) \):
     \[
     P(nx, x) \implies f(nx + x) + f(nx - x) = 2f(nx) + 2f(x) \implies f((n+1)x) + f((n-1)x) = 2f(nx) + 2f(x)
     \]
     By the induction hypothesis:
     \[
     f((n+1)x) + f((n-1)x) = 2n^2 f(x) + 2f(x)
     \]
     We also know from the induction hypothesis:
     \[
     f((n-1)x) = (n-1)^2 f(x)
     \]
     Therefore:
     \[
     f((n+1)x) + (n-1)^2 f(x) = 2n^2 f(x) + 2f(x)
     \]
     Simplifying:
     \[
     f((n+1)x) + (n^2 - 2n + 1) f(x) = 2n^2 f(x) + 2f(x)
     \]
     \[
     f((n+1)x) = 2n^2 f(x) + 2f(x) - (n^2 - 2n + 1) f(x)
     \]
     \[
     f((n+1)x) = (2n^2 + 2 - n^2 + 2n - 1) f(x)
     \]
     \[
     f((n+1)x) = (n^2 + 2n + 1) f(x)
     \]
     \[
     f((n+1)x) = (n+1)^2 f(x)
     \]
     Thus, by induction, \( f(nx) = n^2 f(x) \) holds for all \( n \in \mathbb{N} \).

6. **Extend to negative integers**:
   - For \( n = -1 \):
     \[
     P(x, -x) \implies f(x - x) + f(x + x) = 2f(x) + 2f(-x) \implies f(0) + f(2x) = 2f(x) + 2f(-x) \implies 4f(x) = 2f(x) + 2f(-x)
     \]
     \[
     2f(x) = 2f(-x) \implies f(x) = f(-x)
     \]
     Thus, \( f \) is an even function.

7. **Generalize to rational numbers**:
   - For any rational \( x = \frac{p}{q} \) with \( p, q \in \mathbb{Z} \):
     \[
     f\left(\frac{p}{q}\right) = \left(\frac{p}{q}\right)^2 f(1) = \frac{p^2}{q^2} f(1)
     \]
     Let \( f(1) = a \), where \( a \in \mathbb{Q} \). Then:
     \[
     f\left(\frac{p}{q}\right) = a \left(\frac{p}{q}\right)^2
     \]
     Therefore, the general solution is:
     \[
     f(x) = ax^2 \quad \forall x \in \mathbb{Q}
     \]

Conclusion:
\[
\boxed{f(x) = ax^2 \quad \forall x \in \mathbb{Q}}
\]