Determine all rational numbers $a$ for which the matrix
$$\begin{pmatrix}
    a       & -a & -1 & 0 \\
    a       & -a & 0 & -1 \\
    1  & 0 & a & -a\\
    0      & 1 & a &  -a
\end{pmatrix}$$
is the square of a matrix with all rational entries.

[i]Proposed by Daniël Kroes, University of California, San Diego[/i]
1. **Characteristic Polynomial Calculation:**
   The given matrix \( A \) is:
   \[
   A = \begin{pmatrix}
       a & -a & -1 & 0 \\
       a & -a & 0 & -1 \\
       1 & 0 & a & -a \\
       0 & 1 & a & -a
   \end{pmatrix}
   \]
   We need to find the characteristic polynomial of \( A \), which is given by \( \det(A - xI) \).

2. **Determinant Calculation:**
   \[
   A - xI = \begin{pmatrix}
       a - x & -a & -1 & 0 \\
       a & -a - x & 0 & -1 \\
       1 & 0 & a - x & -a \\
       0 & 1 & a & -a - x
   \end{pmatrix}
   \]
   To find the determinant, we can use cofactor expansion or other methods. After calculation, we find:
   \[
   \det(A - xI) = (x^2 + 1)^2
   \]
   This implies that the eigenvalues of \( A \) are \( i \) and \( -i \), each with multiplicity 2.

3. **Cayley-Hamilton Theorem:**
   By the Cayley-Hamilton theorem, the matrix \( A \) satisfies its own characteristic polynomial:
   \[
   (A^2 + I)^2 = 0
   \]
   This implies that \( A^2 + I \) is a nilpotent matrix of index 2.

4. **Assumption \( A = C^2 \):**
   Assume \( A = C^2 \) for some matrix \( C \) with rational entries. Then:
   \[
   (C^2)^2 + I = 0 \implies C^4 + I = 0
   \]
   This means that \( C \) satisfies the polynomial \( x^4 + 1 \).

5. **Minimal Polynomial of \( C \):**
   The minimal polynomial of \( C \) must divide \( x^4 + 1 \) and have rational coefficients. Since \( x^4 + 1 \) is irreducible over the rationals, the minimal polynomial of \( C \) is \( x^4 + 1 \).

6. **Implication for \( A \):**
   Since \( C^4 + I = 0 \), we have:
   \[
   A^2 + I = 0
   \]
   This implies that \( A^2 = -I \).

7. **Verification:**
   We need to verify if \( A^2 = -I \) holds for the given matrix \( A \). Calculate \( A^2 \):
   \[
   A^2 = \begin{pmatrix}
       a & -a & -1 & 0 \\
       a & -a & 0 & -1 \\
       1 & 0 & a & -a \\
       0 & 1 & a & -a
   \end{pmatrix}^2
   \]
   After performing the matrix multiplication, we find:
   \[
   A^2 = \begin{pmatrix}
       -1 & 0 & 0 & 0 \\
       0 & -1 & 0 & 0 \\
       0 & 0 & -1 & 0 \\
       0 & 0 & 0 & -1
   \end{pmatrix} = -I
   \]
   This holds true if and only if \( a = 0 \).

The final answer is \( \boxed{ a = 0 } \).