Precise definition of $\mathbb{Z}_n[i]$ I have seen the following definition: If $R$ is a subring of $R'$ and $a\in R'$. Then
$$
R[a] = \{f(a): f\in R[x]\}.
$$
This explains well what, for examle, $\mathbb{Z}[i]$ and $\mathbb{Q}[\sqrt{2}]$ are.
My question is how one defines things like $\mathbb{Z}_n[i]$. Here $i\in \mathbb{C}$. The problem is that $\mathbb{Z}_n$ (in the definitions that I have seen) is not a subring of $\mathbb{C}$, so the above definition doesn't work. I get how to actually work with these rings, so I am just asking about the precise definition.
EDIT: I see (with the current answer and with this) that one can do this with quotient rings. I guess my question is if there is a more fundamental way of defining it.
 A: I really don't know, but I wouldn't be surprised if $\mathbb{Z}_n[i]$ meant $\mathbb{Z}_n[x]/\langle x^2+1\rangle$.
A: Yes, $i$ is just meant to indicate a primitive fourth root of unity.  It's not meant to be the "same" $i$ as in $\mathbb{C}$.  Strictly speaking this is I guess an abuse of notation, but it's a harmless one for people already familiar with the subject.
It's definitely unfair for us to push these notional conveniences on people still learning, though.
A: There are two definitions that people use for rings of this form:

Definition: Let $R$ be a ring and let $\alpha\not\in R$ be an element of some $R’$ that extends $R$. Then we define $$R[\alpha]=R[x]/\langle\ker\phi_\alpha\rangle$$ where $\phi_\alpha$ is the map from $R[x]\to R$ that sends $x\to\alpha$. We can that $R[\alpha]=R$ when $\alpha\in R$ for completeness.

Notice that when $\alpha$ is transcendental, the kernel of the map is empty and so we get back $R[x]$ as desired. When $\alpha$ is not transcendental, taking this quotient basically enforces a new rule on $x$, namely that it satisfies $\phi_\alpha(x)=0$. This ensures that $x$ satisfies the necessary algebraic properties to “really be $\alpha$.”

Definition: Let $R$ be a ring and let $\alpha$ be an element of some $R’$ that extends $R$. Then we define $R[\alpha]$ to be the
  unique ring such that
  
  
*
  
*$R[\alpha]$ extends $R$
  
*$\alpha\in R[\alpha]$
  
*If $Q$ is a ring that satisfies $1$ and $2$, then $R[\alpha]\leq Q[\alpha]$
  

The first definition gives a construction of precise the object that satisfies the second definition. Both of these definitions also work for $F(\alpha)$ and $F[\alpha]$ with minor modifications.
A: Take the set $R=\mathbb{Z}_n\times\mathbb{Z}_n$ with multiplication
$$(a,b)(c,d)=(ac-bd,ad+bc),$$
and coordinate-wise addition. It is straightforward to check that this is a ring structure on $R$. It is also straightforward to check that the map
$$\phi:R\to \mathbb{Z}_n/\langle x^2+1\rangle$$
given by
$$\phi(a,b)=[a+bx]$$
is an isomorphism.
A: It is common to use well-known algebraic numbers like $i$, $\sqrt{7}$, or $\zeta_{7}$ (a primitive seventh root of unity) not as specific objects, but instead as abstract recipes.
Given a field $F$, $F(i)$ then means a (minimal) extension field of $F$ that contains a square root of $-1$. Similarly, $F(\sqrt{7})$ contains a square root of $7$, and $F(\zeta_7)$ contains a seventh root of unity.
Note, incidentally, that these extensions aren't always defined by the "obvious" polynomials. For example, while $\mathbf{F}_3(i) \cong \mathbf{F}_3[x] / (x^2 + 1)$, the field $\mathbf{F}_5$ already contains a square root of $-1$, so $\mathbf{F}_5(i) \cong \mathbf{F}_5$, but $\mathbf{F}_5[x]/(x^2 + 1) \cong \mathbf{F}_5 \times \mathbf{F}_5$.
