The Gaussian integer $\mathbb{Z}[i]$ is an Euclidean domain that is not a field, since there is no inverse of $2$. So, where is wrong with the following proof?
Fake proof
First, note that $\mathbb{Z}[X]$ is a integral domain. Since $x^2+1$ is an irreducible element in $\mathbb{Z}[X]$, the ideal $(x^2+1)$ is maximal, which implies $\mathbb{Z}[i]\simeq\mathbb{Z}[X]/(x^2+1)$ is a field.
"Since $x^2+1$ is an irreducible element, the ideal $(x^2+1)$ is maximal"
Is this true in a generic integral domain? Consider the ring $Z[x,y].$ We have that $x$ is an irreducible element, but $(x)$ is not a maximal ideal, as it is contained in the ideal $(x,y)$ which is still not the entire ring.