Let $R$ denote a commutative ring. Consider a polynomial $P(x) \in R[x]$ and a commutative $R$-algebra $S$. Suppose we're given $a \in R$ such that $P(a) = 0$. There's an $R$-algebra homomorphism $R[x]/P(x) \rightarrow S$ given by mapping $x$ to $a$. My question is:
General Question. What assumptions do we need (e.g. on $S$) for this to be injective?
Here's an example of why we might care:
Let $\mathbb{Z}[\sqrt{2}]$ denote the quotient of $\mathbb{Z}[x]$ by the polynomial $x^2-2$.
Let $\mathbb{Z}[\sqrt{2}]$ denote the smallest subring of $\mathbb{R}$ containing the unique $a \in \mathbb{R}$ satisfying the following conditions: $$a^2-2 = 0, \qquad a>0.$$
There's a surjection $\mathbb{Z}[\sqrt{2}] \rightarrow \mathbb{Z}[\sqrt{2}]$ given by mapping $x$ to $a$.
Specific Question. How can we show that this map injective?
To be clear, the actual question I'd like answered is the general one, not the specific one.
Simply show that the quotient of the polynomial ring $\mathbb Z[x]$ by $x^2-2$ has the classes of $1$ and of $x$ as a basis as an abelian group — this follows immediately from the fact that the polynomial is monic. Then just check by hand what you want.