Which one is a field?
i) $\cfrac{\mathbb{Z}[x]}{\langle{x^2+2}\rangle}$
ii)$\cfrac{\mathbb{Q}[x]}{\langle{x^2-2}\rangle}$
I think both are correct because for both the cases ${\langle{x^2+2}\rangle}$ and${\langle{x^2-2}\rangle}$ are irreducible in ${\mathbb{Z}[x]}$ ${\mathbb{Q}[x]}$ respectively.
So please confirm me am I right? Because in book answer is given only option ii).
If $K$ is a field and $f\in K[X]$ is an irreducible polynomial, then $(f)$ is maximal, that is, $K[X]/(f)$ is a field. (Can you prove this?)
If $K$ is an integral domain which is not a field, then the story can be very different. Let $f=X+1$. Obviously $f$ is irreducible in $K[X]$, but $K[X]/(X+1)\simeq K$ which is not a field.
In your case, $K=\mathbb Z$ and $f=X^2+2$. Then $\mathbb Z[X]/(X^2+2)\simeq\mathbb Z[\sqrt{-2}]$ which is an integral domain, but not a field. (For instance, $\sqrt{-2}$ is not invertible.)