This is exercise E.2 from chapter 24 of Pinter's A Book of Abstract Algebra:
If $B$ is an ideal of $A$, $B[x]$ is not necessarily an ideal of $A[x]$. Give an example to prove this contention.
It seems pretty easy to me to construct a proof that $B[x]$ is indeed an ideal of $A[x]$, so I would like to know what's wrong with it:
First we want to show that $B[x]$ is a subgroup of $A[x]$ under addition:
Let $p, q \in B[x]$. To calculate $p+q$ we simply add the corresponding coefficients. Since the coefficients are in $B$ and $B$ is a subgroup, the coefficients of $p+q$ belong to $B$ and so $p+q\in B[x]$.
Let $p \in B[x]$. Again, since $B$ is a subgroup, $-p$ is in $B[x]$.
Now I show that, given any $p \in B[x]$ and $r \in A[x]$, $pr$ and $rp$ are in $B[x]$. The coefficients of $pr$ are given by
$$(pr)_i = \sum_{j+k=i} p_j r_k = \sum_{j=0}^i p_j r_{i-j}$$
Each term of the sum is a product of some $p_j$, which is in $B$, and some element of $A$. Since $B$ is an ideal, all $p_j r_k$ are in $B$, and so is the sum; therefore, $pr \in B[x]$. The same argument works for $rp$.
I seem to have proved that $B[x]$ is an ideal of $A[x]$. Where have I gone wrong?
Your proof is correct. I don't own the book, but I was able to find a version of this via Google (Google-Books should be good enough), and the corrected statement reads:
(For those wondering, the first "ideal" is probably printed in italics because the exercise before asks to show the same statement for subrings instead of for ideals.)