Let $A$ commutative ring with $1$ and $P(X) \in A[X]$ a non constant polynomial. Can it be exactly characterized when the canonical map $f:A \to A[X]/P(X)=:B$ is
(1) flat or
(2) induces surjective map $Spec(f): Spec(B) \to Spec(A), \mathfrak{p} \mapsto \mathfrak{p} \cap A$
Note: in case when (1) and (2) hold at the same time $f$ is called faithfully flat. But in general there is no connection between (1) and (2), therefore these can be studied separately
Question: "..criteria for flatness of map f:A→A[X]/P(X)=:B"
Answer: Assume $B:=A[x_1,..,x_n]/I$ with $I:=(f_1,..,f_k)$. If $A \rightarrow B$ is flat it follows it follows $A \rightarrow B$ is faithfully flat iff for any maximal ideal $\mathfrak{m} \subseteq A$ it follows the ideal $\overline{I} \subseteq k[x_1,..,x_n]$ is not the unit ideal, where $k:=A/\mathfrak{m}$ and $\overline{I}$ is the "reduction of $I$ modulo $k$". This follows from a lemma in Milne, "Etale cohomology":
Characterizing fppf-algebras
Example: In your case, if $f(x):=a_nx^n+\cdots +a_1x+a_0\in A[X]$ it follows $\overline{f(x)}:=\overline{a_n}x^n+\cdots +\overline{a_0} \in k[x]$ with $k:=A/\mathfrak{m}$, is the unit ideal iff $a_i \in \mathfrak{m}$ for $i=1,..,n$ and $a_0 \in A-\mathfrak{m}$. Hence you can read this off the coefficents of $f(x)$. If $f(x)$ is monic of degree $\geq 1$ the map is faithfully flat.
If $P(x)$ is a monic polynomial it follows $A \rightarrow B$ is integral, hence $Spec(B) \rightarrow Spec(A)$ is surjective by Atiyah-Macdonald, Thm 5.10.