I was browsing through some algebraic geometry problems and came across this :
(1) Let $k$ be an algebraically closed field, and $f \in k\left[x_1, \ldots, x_n\right]$ an irreducible polynomial. Prove that the algebraic set $V(f)$ is irreducible.
(2) This is not true if $k$ is not algebraically closed: give an example of an irreducible polynomial $f \in \mathbb{R}[x, y]$ such that $V(f) \subseteq \mathbb{A}_{\mathbb{R}}^2$ is not irreducible.
So I was surprised that part (2) was possible, because I thought that the multivariate polynomial rings are UFDs so all irreducible elements are prime and we know that the vanishing locus of a prime ideal is irreducible set so how is it possible to have an irreducible polynomial $f \in \mathbb{R}[x, y]$ such that $V(f) \subseteq \mathbb{A}_{\mathbb{R}}^2$ is not irreducible? I don' think any of the relevant theorems involved like the Hilbert basis theorem requires us to have an algebraically closed field.