For two quadratic trinomials $P(x)$ and $Q(x)$ there is a linear function $\ell(x)$ such that $P(x)=Q(\ell(x))$ for all real $x$. How many such linear functions $\ell(x)$ can exist?

[i](A. Golovanov)[/i]
1. Let \( P(x) = ax^2 + bx + c \) and \( Q(x) = dx^2 + ex + f \) be two quadratic trinomials, where \( a \neq 0 \) and \( d \neq 0 \).
2. Suppose there exists a linear function \( \ell(x) = mx + n \) such that \( P(x) = Q(\ell(x)) \) for all real \( x \).
3. Substituting \( \ell(x) \) into \( Q \), we get:
   \[
   P(x) = Q(\ell(x)) = Q(mx + n) = d(mx + n)^2 + e(mx + n) + f
   \]
4. Expanding \( Q(mx + n) \):
   \[
   Q(mx + n) = d(m^2x^2 + 2mnx + n^2) + e(mx + n) + f
   \]
   \[
   = dm^2x^2 + 2dmnx + dn^2 + emx + en + f
   \]
   \[
   = dm^2x^2 + (2dmn + em)x + (dn^2 + en + f)
   \]
5. Since \( P(x) = ax^2 + bx + c \), we equate the coefficients of \( x^2 \), \( x \), and the constant term from both sides:
   \[
   ax^2 + bx + c = dm^2x^2 + (2dmn + em)x + (dn^2 + en + f)
   \]
6. Equating the coefficients, we get the following system of equations:
   \[
   a = dm^2
   \]
   \[
   b = 2dmn + em
   \]
   \[
   c = dn^2 + en + f
   \]
7. From the first equation, solve for \( m \):
   \[
   m^2 = \frac{a}{d} \implies m = \pm \sqrt{\frac{a}{d}}
   \]
8. Let \( m_1 = \sqrt{\frac{a}{d}} \) and \( m_2 = -\sqrt{\frac{a}{d}} \). These are the two possible values for \( m \).
9. For each \( m \), solve for \( n \) using the second equation:
   \[
   b = 2dmn + em \implies b = m(2dn + e)
   \]
   \[
   n = \frac{b - em}{2dm}
   \]
10. Substituting \( m_1 \) and \( m_2 \) into the equation for \( n \):
    \[
    n_1 = \frac{b - e\sqrt{\frac{a}{d}}}{2d\sqrt{\frac{a}{d}}} = \frac{b - e\sqrt{\frac{a}{d}}}{2\sqrt{ad}}
    \]
    \[
    n_2 = \frac{b + e\sqrt{\frac{a}{d}}}{-2d\sqrt{\frac{a}{d}}} = \frac{b + e\sqrt{\frac{a}{d}}}{-2\sqrt{ad}}
    \]
11. Therefore, the two linear functions \( \ell(x) \) are:
    \[
    \ell_1(x) = \sqrt{\frac{a}{d}}x + \frac{b - e\sqrt{\frac{a}{d}}}{2\sqrt{ad}}
    \]
    \[
    \ell_2(x) = -\sqrt{\frac{a}{d}}x + \frac{b + e\sqrt{\frac{a}{d}}}{-2\sqrt{ad}}
    \]

Conclusion:
There are exactly two such linear functions \( \ell(x) \) that satisfy the given condition.

The final answer is \( \boxed{2} \)