Determine all non-constant polynomials $X^n+a_{n-1}X^{n-1}+\cdots +a_1X+a_0$ with integer coefficients for which the roots are exactly the numbers $a_0,a_1,\ldots ,a_{n-1}$ (with multiplicity).
1. **Initial Claim and Setup:**
   We claim that the only such polynomials are \(x^n\), \(x^{n-2}(x^2 + x - 2)\), and \(x^{n-3}(x^3 + x^2 - x - 1)\). Each of these polynomials clearly works as they satisfy the given conditions.

2. **Reduction to Non-zero \(a_0\):**
   Note that we can always multiply and divide the polynomial by \(x^k\). Thus, we will consider the case where \(a_0 \neq 0\).

3. **Vieta's Relations:**
   By Vieta's formulas, the product of the roots (with sign) is given by:
   \[
   \prod_{i=0}^{n-1} (-a_i) = a_0 \implies \prod_{i=1}^{n-1} a_i = (-1)^n
   \]
   This implies that all \(a_i\) are either \(-1\) or \(1\).

4. **Exclusion of Small \(n\):**
   Additionally, note that \(n = 0, 1\) clearly fail since \(a_0 \neq 0\).

5. **Bounding \(a_0\):**
   **Claim:** \(a_0 \in \{-2, -1, 0, 1\}\)

   **Proof:**
   - For positive \(a_0\), consider the polynomial:
     \[
     \sum_{i=0}^{n} a_i x^i \geq a_0^n - a_0^{n-1} - \cdots - a_0 + a_0
     \]
     This expression is \(> 0\) for all \(a_0 \geq 2\).
   - For negative \(a_i\), a similar argument yields that \(a_0 \geq -2\).

   Therefore, \(a_0 \in \{-2, -1, 0, 1\}\). \(\blacksquare\)

6. **Case Analysis for \(a_0\):**
   - If \(a_0 = -2\), then the equality case must be held, which is:
     \[
     x^{2k} + x^{2k-1} - x^{2k-2} + x^{2k-2} - x^{2k-3} \cdots - x^2 + x - 2
     \]
     However, this fails by plugging in \(x = -1\) for \(k \geq 2\). Thus, \(a_0 = -2\) is not possible.
   - If \(a_0 = 2\), then:
     \[
     f(x) = x^2 + x - 2
     \]

7. **Divisibility by \((x+1)\) and \((x-1)\):**
   - If \(a_0 \in \{-1, 1\}\), then the polynomial must be divisible by \((x+1)\) because \(x^n + x^{n-1} + \cdots + 1 \neq (x-1)^n\) clearly fails.
   - It also must be divisible by \((x-1)\) because \(x^n - x^{n-1} - \cdots - x - 1 \neq (x+1)^n\) also fails.

8. **Sum of Coefficients:**
   - Note that \(\sum_{i=1}^{n-1} a_i = -a_{n-1} \in \{-1, 1\}\). Thus, there are \(M\) 1s and \(M+1\) -1s, or \(M+1\) 1s and \(M\) -1s. Regardless,
     \[
     a_{n-2} = \binom{M}{2} + \binom{M+1}{2} - M(M+1) = -M \in \{-1, 1\}
     \]
   - Thus, the only two remaining choices are \((x+1)^2(x-1) = x^3 + x^2 - x - 1\) and \((x-1)^2(x+1) = x^3 - x^2 - x + 1\). The second one fails, so we have shown that the three classes we outlined at the beginning are the only choices. \(\blacksquare\)

The final answer is \( \boxed{ x^n } \), \(x^{n-2}(x^2 + x - 2)\), and \(x^{n-3}(x^3 + x^2 - x - 1)\).