$f(x,y)$ is a real polynomial such that in the equation $f(x,y)=0$ we can express $x$ in $y$ with composition of polynomial functions and square roots, and can express $y$ in $x$ with composition of polynomial functions and square roots.
The curve $f(x,y)=0$ on $\Bbb R^2$ has $n$ connected components.
Is it true that we can always find $f_1,\dots,f_n$, each of which is a composition of polynomial functions and square roots, such that $f=\prod_{i=1}^nf_i$ and the curve $f_i=0$ has one-to-one correspondence with the connected components?
Example: $f(x,y)=x^2-y^2-1$.
Clearly in the equation $f(x,y)=0$ we can express $x$ in $y$ with $x=\pm\sqrt{1+y^2}$ and express $y$ in $x$ with $y=\pm\sqrt{x^2-1}$.
$f(x,y)=0$ has $2$ connected components.
and we can find $f_1,f_2$: $$x^2-y^2-1=f_1f_2=(x+\sqrt{y^2+1})(x-\sqrt{y^2+1})$$ and the curves $f_1=0,f_2=0$ are the two components.
Example: $f(x,y)=2 x^2 y^2 + 1.5-(x^2 - 1)^2 - (y^2 - 1)^2$.
It is quadratic in $x^2,y^2$ so in the equation $f(x,y)=0$ we can express $x$ in $y$ with composition of polynomial functions and square roots, and can express $y$ in $x$ with composition of polynomial functions and square roots.
The curve $f(x,y)=0$ has $5$ connected components:
I checked that $2 x^2 y^2 + 1.5-(x^2 - 1)^2 - (y^2 - 1)^2=f_1f_2f_3f_4f_5$ by WolframAlpha.
$f_1=\frac{\sqrt{x^{2}+\frac{1}{8}}+\sqrt{y^{2}+\frac{1}{8}}-1}{\sqrt{x^{2}+\frac{1}{8}}+\sqrt{y^{2}+\frac{1}{8}}+1}$
$f_2=x-\sqrt{\left(1+\sqrt{y^{2}+\frac{1}{8}}\right)^{2}-\frac{1}{8}}$
$f_3=x+\sqrt{\left(1+\sqrt{y^{2}+\frac{1}{8}}\right)^{2}-\frac{1}{8}}$
$f_4=y-\sqrt{\left(1+\sqrt{x^{2}+\frac{1}{8}}\right)^{2}-\frac{1}{8}}$
$f_5=y+\sqrt{\left(1+\sqrt{x^{2}+\frac{1}{8}}\right)^{2}-\frac{1}{8}}$
and the curves $f_1=0,f_2=0,f_3=0,f_4=0,f_5=0$ are the five components.

