Find all polynomials $P\in\mathbb{Z}[x]$ such that $$|P(x)-x|\leq x^2+1$$ for all real numbers $x$.
1. Let \( Q(x) = P(x) - x \). We need to find \( P(x) \) such that \( |Q(x)| \leq x^2 + 1 \) for all real numbers \( x \).
2. Since \( |Q(x)| \leq x^2 + 1 \), we have:
   \[
   \lim_{x \to +\infty} \frac{Q(x)}{x^3} = 0
   \]
   This implies that the degree of \( Q(x) \) must be less than or equal to 2. Therefore, we can write:
   \[
   Q(x) = ax^2 + bx + c
   \]
   where \( a, b, c \in \mathbb{Z} \).
3. We now have the inequality:
   \[
   |ax^2 + bx + c| \leq x^2 + 1 \quad \forall x
   \]
   This can be split into two inequalities:
   \[
   x^2 + 1 \geq ax^2 + bx + c \quad \text{and} \quad x^2 + 1 \geq -ax^2 - bx - c \quad \forall x
   \]
4. Simplifying these inequalities, we get:
   \[
   (1 - a)x^2 - bx + (1 - c) \geq 0 \quad \text{and} \quad (1 + a)x^2 + bx + (1 + c) \geq 0 \quad \forall x
   \]
5. Consider the case \( a = -1 \):
   \[
   2x^2 - bx + (1 - c) \geq 0 \quad \text{and} \quad bx + (1 + c) \geq 0 \quad \forall x
   \]
   The second inequality implies \( b = 0 \) because otherwise, it would not hold for all \( x \). Thus, we have:
   \[
   2x^2 + (1 - c) \geq 0 \quad \text{and} \quad 1 + c \geq 0 \quad \forall x
   \]
   This simplifies to:
   \[
   1 - c \geq 0 \quad \text{and} \quad 1 + c \geq 0 \implies c \in [-1, 1]
   \]
6. Consider the case \( a = 1 \):
   \[
   -bx + (1 - c) \geq 0 \quad \text{and} \quad 2x^2 + bx + (1 + c) \geq 0 \quad \forall x
   \]
   The first inequality implies \( b = 0 \) because otherwise, it would not hold for all \( x \). Thus, we have:
   \[
   1 - c \geq 0 \quad \text{and} \quad 2x^2 + (1 + c) \geq 0 \quad \forall x
   \]
   This simplifies to:
   \[
   1 - c \geq 0 \quad \text{and} \quad 1 + c \geq 0 \implies c \in [-1, 1]
   \]
7. Consider the case \( a \neq \pm 1 \):
   \[
   (1 - a)x^2 - bx + (1 - c) \geq 0 \quad \text{and} \quad (1 + a)x^2 + bx + (1 + c) \geq 0 \quad \forall x
   \]
   For these inequalities to hold for all \( x \), the quadratic expressions must be non-negative for all \( x \). This implies:
   \[
   1 - a > 0 \quad \text{and} \quad 1 + a > 0 \implies a \in (-1, 1)
   \]
   Additionally, the discriminants of the quadratic expressions must be non-positive:
   \[
   b^2 - 4(1 - a)(1 - c) \leq 0 \quad \text{and} \quad b^2 - 4(1 + a)(1 + c) \leq 0
   \]
   These conditions imply:
   \[
   c \in [-1, 1] \quad \text{and} \quad b^2 \leq 4(1 + ac - |a + c|)
   \]

Hence, the result is:
\[
P(x) = ax^2 + (b + 1)x + c
\]
with the constraints:
- \( |c| \leq 1 \)
- Either \( |a| = 1 \) and \( b = 0 \)
- Or \( |a| < 1 \) and \( |b| \leq 2\sqrt{1 + ac - |a + c|} \)

The final answer is \( \boxed{ P(x) = ax^2 + (b + 1)x + c } \) with the given constraints.