There is another way to think about this problem. Since $R:= \mathbb R[x,y]/(x^2 +y^2 -1 )$ is a smooth affine curve, it is a normal ring (i.e. integrally closed in its fraction field), and so it is factorial if and only if it has trivial class group.
Here and below I will use ideas discussed in Hartshorne, Ch.II.6, in the subsection on Weil divisors.
We may consider $U :=$ Spec $R$ as an affine open curve, and then consider its projective closure $X$. The curve $X$ is a plane conic, and so its class group (equivalently, its Picard group) is isomorphic to $\mathbb Z$, generated by the class of any rational point (e.g. the class of the point $(1,0)$).
Now $Z := X \setminus U$ is irreducible (it is a single point of $X$, which geometrically becomes two points, namely the two points at infinity $[1:\pm i: 0]$ --- note that neither of these points is individually defined over $\mathbb R$, but their union is, and so it corresponds to a single point on $X$ with residue field equal to $\mathbb C$); this is where we use that our curve is defined over $\mathbb R$ rather than $\mathbb C$. (In the latter case $Z$ is not irreducible, but is the union of the preceding two points, which are now both defined over $\mathbb C$.)
We now use the exact sequence of Hartshorne II.6, Prop. 6.5, namely
$$\mathbb Z \to \mathrm{Cl}(X) \to \mathrm{Cl}(U) \mapsto 0,$$
where the first arrow is defined by $n \mapsto $ the class of $nZ$.
Recalling that Cl$(X) = \mathbb Z$, and that
$Z$ corresponds to a pair of points over $\mathbb C$, this
exact sequence can be written more explicitly as
$$\mathbb Z \to \mathbb Z \to \mathrm{Cl}(U) \to 0,$$
where the first map is multiplication by $2$.
Thus Cl$(R) = $ Cl$(U) = \mathbb Z/2$, and we see that $R$ is not a UFD.
Explicitly, we see that a maximal ideal in $R$ will be principal precisely
if its residue field is equal to $\mathbb C$ (rather than $\mathbb R$).
Thus e.g. the maximal ideal $(x,y-1)$, which cuts out the point $(0,1)$ and
has residue field $\mathbb R$, is not principal.
One can think about this more geometrically:
If the maximal ideal cutting out a point $P$ over $\mathbb R$ is principal,
then it is generated by some real polynomial $f(x,y)$. But then the ideal $(f)$ in $R$ is a product of maximal ideals corresponding to the intersection of the curve $f = 0$ with the curve $U$. By assumption this is just the single point $P$, with multiplicity one, and so (now passing from the affine picture to the projective picture) all the other intersections must be with the two points in $Z$. By Bezout, the total number of intersections of $f = 0$ with $X$ is even, and we are assuming the intersection of $f = 0$ with $U$ consists of the single point $P$, so in fact the number of intersections with $Z$ must be odd. But this set of intersections (counted with multiplicity) is symmetric under complex conjugation (since $f$ has real coefficients) and so it must be even (because the two points of $Z$ are interchanged by complex conjugation). This contradiction shows that the maximal ideal of $P$ is not principal. (This is more or less a rewriting of the proof of Hartshorne's Prop. 6.5 in this
particular case.)
It is also easy to see what happens when we extend scalars from $\mathbb R$ to $\mathbb C$, i.e. pass from $R$ to $S$. The set $Z$ now becomes the union of two points, and so for any point $P$ of $U$ (now over $\mathbb C$) we can find a generator of the maximal ideal by choosing $f$ to be the equation of a line passing through $P$ and one of the two points in $Z$. E.g. for $P = (0,1)$, we can take a generator of the ideal $(x,y-1)$ to be $(y - 1 \pm ix)$. (Either choice of sign will do; their ratio is a unit in $S$.)
In terms of the exact sequence of class groups, $Z$ is no longer irreducible,
but the union of two points each of degree one, and so the exact sequence becomes
$$\mathbb Z \oplus \mathbb Z \to \mathrm{Cl}(X_{/\mathbb C}) \to
\mathrm{Cl}(U_{/\mathbb C}) \to 0,$$
which more explicitly is $$\mathbb Z \oplus \mathbb Z \to \mathbb Z \to \mathrm{Cl}(U_{/\mathbb C}) \to 0,$$
with the first map being given just by $(m,n) \mapsto m+n$.
Evidently this map is surjective, and so
Cl$(S) =$ Cl$(U_{/\mathbb C}) = 0.$