Find all functions $f: \mathbb{Q}[x] \to \mathbb{R}$ such that: 
(a) for all $P, Q \in \mathbb{Q}[x]$,  $f(P \circ Q) = f(Q \circ P);$
(b) for all $P, Q \in \mathbb{Q}[x]$ with $PQ \neq 0$, $f(P\cdot Q) = f(P) + f(Q).$ 

($P \circ Q$ indicates $P(Q(x))$.)
1. **Lemma 1: \( f(c) = 0 \) for all constants \( c \) and \( f(P) = f(Q) \) if \( \deg(P) = \deg(Q) \)**

   **Proof:**
   - Consider \( Q(x) = 1 \) in condition (b). Then for any polynomial \( P \),
     \[
     f(P \cdot 1) = f(P) + f(1).
     \]
     Since \( P \cdot 1 = P \), we have
     \[
     f(P) = f(P) + f(1).
     \]
     This implies \( f(1) = 0 \).

   - Now, let \( P \) be a constant polynomial, say \( P(x) = c \). Then for any non-zero polynomial \( Q \),
     \[
     f(c \cdot Q) = f(c) + f(Q).
     \]
     Since \( c \cdot Q \) is just a constant multiple of \( Q \), and considering \( Q(x) = 1 \), we get
     \[
     f(c) = f(c \cdot 1) = f(c) + f(1) = f(c) + 0.
     \]
     Thus, \( f(c) = 0 \) for all constants \( c \in \mathbb{Q} \).

   - Next, consider linear polynomials \( P(x) = a_1 x + b_1 \) and \( Q(x) = a_2 x + b_2 \). If \( \deg(P) = \deg(Q) = 1 \), then
     \[
     f(P \circ Q) = f(Q \circ P).
     \]
     Since both compositions are linear polynomials with the same leading coefficient, we have \( f(P) = f(Q) \).

   - Moreover, for any polynomial \( Q \) and any constant \( c \in \mathbb{Q} \),
     \[
     f(cQ) = f(Q).
     \]
     This follows from the fact that \( cQ \) is just a scaled version of \( Q \), and since \( f(c) = 0 \), we have
     \[
     f(cQ) = f(c) + f(Q) = 0 + f(Q) = f(Q).
     \]

   Therefore, \( f(c) = 0 \) for all constants \( c \in \mathbb{Q} \) and \( f(P) = f(Q) \) if \( \deg(P) = \deg(Q) \).

   \(\blacksquare\)

2. **Lemma 2: \( f(P) = c \cdot \deg(P) \) for some \( c \in \mathbb{R} \)**

   **Proof:**
   - We will use strong induction on the degree \( n \) of the polynomial \( P \).

   - **Base Case:**
     For \( \deg(P) = 0 \), \( P \) is a constant polynomial. From Lemma 1, we have \( f(P) = 0 \).

   - **Inductive Step:**
     Assume that for all polynomials \( P \) with \( \deg(P) \leq d \), we have \( f(P) = c \cdot \deg(P) \) for some constant \( c \in \mathbb{R} \).

     - Consider a polynomial \( P \) with \( \deg(P) = d+1 \).

     - If \( P \) is reducible, we can write \( P = R_1 \cdot R_2 \) for polynomials \( R_1 \) and \( R_2 \) with smaller degrees. By the induction hypothesis,
       \[
       f(P) = f(R_1 \cdot R_2) = f(R_1) + f(R_2) = c \cdot \deg(R_1) + c \cdot \deg(R_2) = c \cdot (\deg(R_1) + \deg(R_2)) = c \cdot \deg(P).
       \]

     - If \( P \) is irreducible, consider \( Q(x) = P(x) - a_0 \) where \( a_0 \) is the constant term of \( P \). Then \( Q \) is reducible, and we can write \( Q = R_1 \cdot R_2 \) for some polynomials \( R_1 \) and \( R_2 \) with smaller degrees. By the induction hypothesis,
       \[
       f(Q) = f(R_1 \cdot R_2) = f(R_1) + f(R_2) = c \cdot \deg(R_1) + c \cdot \deg(R_2) = c \cdot (\deg(R_1) + \deg(R_2)) = c \cdot \deg(Q).
       \]
       Since \( Q(x) = P(x) - a_0 \), we have
       \[
       f(P) = f(Q + a_0) = f(Q) + f(a_0) = c \cdot \deg(Q) + 0 = c \cdot \deg(P).
       \]

   Therefore, by induction, \( f(P) = c \cdot \deg(P) \) for some constant \( c \in \mathbb{R} \).

   \(\blacksquare\)

The final answer is \( \boxed{ f(P) = c \cdot \deg(P) } \) for some \( c \in \mathbb{R} \).