Show that the set of all polynomials whose constant term is a multiple of 3 is an ideal of the ring $Z[x]$.
Attempt: Suppose then we need to show
if $p(x), q(x) \in I$ then $p(x) + q(x) \in I$ and if $r(x) \in Z[x]$ , then $p(x)r(x) \in I$ and $r(x)p(x) \in I$.
And $0 \in Z$, then $0 \in I$.
Then let
$I =$ {$a_nx^n + a_{n-1}x^{n-1} + ...+a_1x + a_0$ | $a_i \in Z$, $a_0\in 3Z$}
$p(x) = a_nx^n + a_{n-1}x^{n-1} + ...+a_1x + 3a$
and $q(x) = b_mx^n + b_{m-1}x^{n-1} + ...+b_1x + 3b$
Here we do not assume that $p(x) $ and $q(x)$ have the same degree. Then $p(x) + q(x) = [a_nx^n + a_{n-1}x^{n-1} + ...+a_1x + 3a] + [b_mx^n + b_{m-1}x^{n-1} + ...+b_1x + 3b] = 3(a + b) + (a_1 + b_1)x + ....+ (a_n + b_m)x^n$.
so $p(x) + q(x) \in I$
And $0 \in Z$ is also in $I$, since for $p(x) = 0x^n + ....+ 3(0) = 0$.
And let $r(x)= c_nx^n + ...+3c \in Z[x] $.
Then $r(x)p(x) = 3(3ac) + (3b_1 + 3a_1) + ....+ a_nb_mx^{2n}$
So $r(x)p(x) \in I$.
Can someone please help? I am not really sure how to prove this. I am getting confused with the underscrips Any help or better approach would really help. Thanks in advance!
A better approach would be to prove that the set of polynomials with constant term a multiple of 3 is the ideal generated by $X$ and $3$. Namely it is $\{Xf(X)+3g(X) \ \vert \ f,g \in \mathbb{Z}[X]\}$, which is more easily proven to be an ideal.