Hint: $q$ prime $\:\Rightarrow\:qA[x]$ prime follows from examining leading coefficients mod $q$, i.e.
${\rm mod}\ q:\: f,g \not\equiv 0\:\Rightarrow f \equiv a\:x^n+\cdots,\ \ g \equiv b\:x^m+\:\cdots,\ a,b\not\in q,\:$ where $\cdots$ means lower degree terms. Hence we deduce $\:fg \equiv ab\:x^{n+m}+\cdots,\ ab\not\in q\:\Rightarrow\: fg \not\equiv 0$.
Note: for $q = 0$ the proof becomes: domain $A\:\Rightarrow\:$ domain $A[x]$. The proof works by exploiting the multiplicativity of the leading coefficient map combined with the nonexistence of zero-divisors in a domain, to show that the product of nonzero polynomials remains nonzero because the same holds true for their leading coefficients.
This is a prototypical example of using a multiplicative map to transfer multiplicative properties from one monoid to another (here the nonexistence of zero-divisors). For some further examples, see this post on using norms to transfer multiplicative properties between $\mathbb Z$ and rings of algebraic integers, and also this post where one deduces the existence of inverses of domain elements $\ne 0$ that are algebraic over a subfield (generalizing rationalizing denominators).
Note: one can reduce to the case $A$ is a domain by factoring out by the prime $q$. However, when learning these techniques, it is instructive to compare the structural vs. element-wise proofs.
Note also that this may be viewed as a generalization of one form of Gauss's Lemma.