Let $f(x)=x^2+bx+1,$ where $b$ is a  real number. Find the number of integer solutions to the inequality $f(f(x)+x)<0.$
To solve the problem, we need to analyze the inequality \( f(f(x) + x) < 0 \) where \( f(x) = x^2 + bx + 1 \). We will break down the solution into detailed steps.

1. **Express \( f(f(x) + x) \) in terms of \( x \):**
   \[
   f(x) = x^2 + bx + 1
   \]
   Let \( y = f(x) + x \). Then,
   \[
   y = x^2 + bx + 1 + x = x^2 + (b+1)x + 1
   \]
   Now, we need to find \( f(y) \):
   \[
   f(y) = (x^2 + (b+1)x + 1)^2 + b(x^2 + (b+1)x + 1) + 1
   \]

2. **Simplify \( f(y) \):**
   \[
   f(y) = (x^2 + (b+1)x + 1)^2 + b(x^2 + (b+1)x + 1) + 1
   \]
   Expanding \( (x^2 + (b+1)x + 1)^2 \):
   \[
   (x^2 + (b+1)x + 1)^2 = x^4 + 2(b+1)x^3 + (b^2 + 2b + 1)x^2 + 2(b+1)x + 1
   \]
   Therefore,
   \[
   f(y) = x^4 + 2(b+1)x^3 + (b^2 + 2b + 1)x^2 + 2(b+1)x + 1 + bx^2 + b(b+1)x + b + 1
   \]
   Simplifying further,
   \[
   f(y) = x^4 + 2(b+1)x^3 + (b^2 + 3b + 1)x^2 + (2b + 2)x + (b + 2)
   \]

3. **Analyze the inequality \( f(f(x) + x) < 0 \):**
   We need to find the values of \( x \) for which:
   \[
   x^4 + 2(b+1)x^3 + (b^2 + 3b + 1)x^2 + (2b + 2)x + (b + 2) < 0
   \]

4. **Consider the roots of \( f(x) \):**
   The roots of \( f(x) = 0 \) are given by:
   \[
   x = \frac{-b \pm \sqrt{b^2 - 4}}{2}
   \]
   Let \( r_1 \) and \( r_2 \) be the roots, where \( r_1 < r_2 \).

5. **Case 1: \( |b| \leq 2 \):**
   If \( |b| \leq 2 \), the discriminant \( b^2 - 4 \) is non-positive, meaning the quadratic \( f(x) \) has no real roots or a double root. In this case, \( f(x) \geq 0 \) for all \( x \), and thus \( f(f(x) + x) \geq 0 \). Therefore, there are no solutions to the inequality \( f(f(x) + x) < 0 \).

6. **Case 2: \( |b| > 2 \):**
   If \( |b| > 2 \), the quadratic \( f(x) \) has two distinct real roots \( r_1 \) and \( r_2 \). We need to analyze the intervals where \( f(f(x) + x) < 0 \).

   - If \( |b| \geq \sqrt{5} \), the roots \( r_1 \) and \( r_2 \) are such that \( r_2 - r_1 > 1 \). This implies that \( f(x) \) changes sign between \( r_1 \) and \( r_2 \). The intervals where \( f(f(x) + x) < 0 \) are \( (r_1 - 1, r_1) \) and \( (r_2 - 1, r_2) \).

   - If \( |b| \in (2, \sqrt{5}) \), we need to consider the specific values of \( b \). If \( b = a + \frac{1}{a} \) for some integer \( a \neq 0, \pm 1 \), there is a unique solution. Otherwise, there are exactly two solutions.

7. **Conclusion:**
   - For \( |b| \leq 2 \), there are no solutions.
   - For \( |b| > 2 \):
     - If \( b = a + \frac{1}{a} \) for some integer \( a \neq 0, \pm 1 \), there is one solution.
     - Otherwise, there are exactly two solutions.

The final answer is \( \boxed{2} \) (for the general case where \( |b| > 2 \) and \( b \neq a + \frac{1}{a} \) for some integer \( a \neq 0, \pm 1 \)).