Let $n\in\mathbb N$, and write $n = p_1^{e_1}\cdots p_r^{e_r}$ for its unique prime factorization. Let $f,g\in\mathbb Z[x]$. I want to understand why we have an isomorphism:
$$(\mathbb Z/n\mathbb Z)[x]/(f,g) \cong \prod_{i =1}^r (\mathbb Z/p^{e_i}_i
\mathbb Z[x]/(f,g))
$$
By the CRT and using the UP of polynomial rings and direct products, we obtain an isomorphism
$$
\mathbb Z/n\mathbb Z[x]\cong\prod (\mathbb Z/p_i^{e_i}\mathbb Z[x])
$$
We also know that the ideal $(f,g)$ is mapped into the ideal $\prod (f,g)$ of $\prod (\mathbb Z/p_i^{e_i}\mathbb Z[x])$. How to show this is onto?