Let $a$ be a real number and $b$ a real number with $b\neq-1$ and $b\neq0. $  Find all pairs $ (a, b)$ such that $$\frac{(1 + a)^2 }{1 + b}\leq 1 + \frac{a^2}{b}.$$    For which pairs (a, b) does equality apply? 
(Walther Janous)
We need to find all pairs \((a, b)\) such that 
\[
\frac{(1 + a)^2 }{1 + b} \leq 1 + \frac{a^2}{b}
\]
and determine for which pairs equality holds.

### Case 1: \(b > 0\) or \(b < -1\)

1. **Multiply both sides by \(b(1 + b)\):**
   Since \(b \neq 0\) and \(b \neq -1\), we can safely multiply both sides by \(b(1 + b)\) without changing the direction of the inequality:
   \[
   b(1 + b) \cdot \frac{(1 + a)^2}{1 + b} \leq b(1 + b) \left(1 + \frac{a^2}{b}\right)
   \]
   Simplifying, we get:
   \[
   b(1 + a)^2 \leq b(b + 1) + a^2(b + 1)
   \]

2. **Expand and simplify:**
   \[
   b(1 + a)^2 = b(1 + 2a + a^2)
   \]
   \[
   b(b + 1) + a^2(b + 1) = b^2 + b + a^2b + a^2
   \]
   Thus, the inequality becomes:
   \[
   b + 2ab + a^2b \leq b^2 + b + a^2b + a^2
   \]

3. **Subtract common terms:**
   \[
   2ab \leq b^2 + a^2
   \]

4. **Rearrange to form a perfect square:**
   \[
   a^2 - 2ab + b^2 \geq 0
   \]
   \[
   (a - b)^2 \geq 0
   \]
   This inequality is always true since the square of any real number is non-negative. Equality holds if and only if \(a = b\).

### Case 2: \(-1 < b < 0\)

1. **Multiply both sides by \(b(1 + b)\):**
   Since \(b \neq 0\) and \(b \neq -1\), we can safely multiply both sides by \(b(1 + b)\). However, since \(b(1 + b) < 0\) in this range, we need to reverse the inequality:
   \[
   b(1 + b) \cdot \frac{(1 + a)^2}{1 + b} \geq b(1 + b) \left(1 + \frac{a^2}{b}\right)
   \]
   Simplifying, we get:
   \[
   b(1 + a)^2 \geq b(b + 1) + a^2(b + 1)
   \]

2. **Expand and simplify:**
   \[
   b(1 + a)^2 = b(1 + 2a + a^2)
   \]
   \[
   b(b + 1) + a^2(b + 1) = b^2 + b + a^2b + a^2
   \]
   Thus, the inequality becomes:
   \[
   b + 2ab + a^2b \geq b^2 + b + a^2b + a^2
   \]

3. **Subtract common terms:**
   \[
   2ab \geq b^2 + a^2
   \]

4. **Rearrange to form a perfect square:**
   \[
   a^2 - 2ab + b^2 \leq 0
   \]
   \[
   (a - b)^2 \leq 0
   \]
   This inequality is only true if \((a - b)^2 = 0\), which implies \(a = b\).

### Conclusion:
The inequality holds for all pairs \((a, b)\) with \(b < -1\) or \(b > 0\), and equality holds if and only if \(a = b\).

The final answer is \( \boxed{ (a, b) } \) with \(b < -1\) or \(b > 0\), and equality for all pairs \((a, a)\).