For $\mathbb{Z}$, you are right: it is reducible because you can factor by $2$, which is not invertible.
Over fields of characteristic $0$ (for example $\mathbb{Q},\mathbb{R},\mathbb{C}$), $2$ is invertible, so this is not a decomposition. In fact, every non-zero polynomial of degree $0$ is invertible. Hence, if you want to decompose your polynomial of degree $2$, you have to write it as $f(x)=p(x)q(x)$, where the degree of $p$ and $q$ is one. This implies that both $p(x)$ and $q(x)$ have a root in your field, and so does $f(x)$.
Over $\mathbb{C}$, you can see that $\pm i\sqrt{2}$ are the roots of $f(x)$, and can then see that $f$ is not irreducible. For instance, write $f(x)=(x-i\sqrt{2})(2x+2i\sqrt{2})$.
But neither $i\sqrt{2}$ not $- i\sqrt{2}$ belongs to $\mathbb{R}$, so your polynomial is irreducible over $\mathbb{R}$. The same works of course for $\mathbb{Q}$.