TITLE: An irreducible polynomial $f \in \mathbb R[x,y]$, whose zero set in $\mathbb A_{\mathbb R}^2$ is not irreducible
QUESTION [14 upvotes]: This is an exercise on Page 8 of Hartshone's Algebraic Geometry:

Give an example of an irreducible polynomial $f \in \mathbb R[x,y]$, whose zero set $Z(f)$ in $\mathbb A_{\mathbb R}^2$ is not irreducible.

I think such an example must come from the fact that $\mathbb R$ is not algebraically closed. But I have no idea as to finding a concrete one.
Thanks very much.

REPLY [4 votes]: Added: This answer interprets "irreducible" to mean with respect to the classical (analytic) topology on $C(\mathbb{R})$, not the (relative) Zariski topology.
Consider the elliptic curve $y^2 = x^3 + Ax + B$, for $A,B \in \mathbb{R}$ with
$\Delta = 4A^3 + 27B^2 \neq 0$.  
Then the polynomial $f(x,y) = x^3 + Ax + B - y^2$ is irreducible.  However the real zero set of $f$ has two components iff $x^3 + Ax + B$ has three real roots (see e.g. this picture for a good idea of what's going on here).  Thus taking for instance $A = -1, B = 0$ gives an answer to the question.  
If you want to think about things this way, a natural followup result is Harnack's Theorem: if $C/\mathbb{R}$ is a smooth, geometrically integral projective curve of genus $g$, then the real locus $C(\mathbb{R})$ has at most $g+1$ connected (hence irreducible, by smoothness) components, and all numbers of components between $0$ and $g+1$ are possible.  Thus the above example is in some sense the simplest.