Does there exist a rational function $g(x,y)$ that picks out the first quadrant? Problem statement: Let $V = \{(x,y) \in \mathbb{R}^2 : x,y>0\}$ be the first quadrant of the plane.
Does there exist a rational function $g : \mathbb{R}^2 \rightarrow \mathbb{R}$ such that $g(V)$ and $g(\mathbb{R}^2 \backslash V)$ are disjoint?
An easier formulation of this problem could be: does there exist a rational function $g(x,y)$ such that $g(x,y)>0$ iff $x,y>0$? I think this could be solved by an appeal to this question, which shows the answer is no for polynomials, but I can't quite work out the details.
I realize there is some ambiguity about whether $g$ is defined everywhere; feel free to interpret that however you wish.
Context: This problem arose while trying to answer another question on this site.
 A: The sign of $g$ is determined by the sign of the numerator and denominator; and when the denominator is non-zero, you can multiply by its square without changing the sign:$$
g(x,y)=\frac{n(x,y)}{d(x,y)}\\
d(x,y)\ne 0 \Rightarrow\operatorname{sign}(g(x,y))=\operatorname{sign}(g(x,y)d(x,y)^2)
$$
Thus, the existence of such a rational function would mean the existence of a polynomial as well -- which we know isn't the case.
A: There is no real analytic function like that ( although there exist a smooth function, cf Whitney's theorem).
The proof works the same way. Write $g(x,y) = (x y)^n \cdot h(x,y)$ where $h(x,y)$ is not divisible by $x y$ ( do this locally around $(0,0)$) .  Now the proof works again like the proof for polynomials, that is get a contradiction since again $x y$ divides $h(x,y)$.
A: Due to @Alex K's nice trick, we need to equivalently prove whether a polynomial of $x$ and $y$ exists to fulfill the property.
The solution to this question is correct (and I upvoted after reading). I guess it can be stated more rigorously, which I present here.
Let us assume such a polynomial exists of the form of $p(x,y)=\sum_{m=0}^\infty\sum_{n=0}^\infty a_{m,n}x^my^n$. Since $p(x,y)$ should be positive for $x>0,y>0$ and negative for $x>0,y<0$, we conclude due to the continuity of polynomials that $p(x,0)=0$ for $x>0$. Similarly, $p(0,y)=0$ for $y>0$. Since $p(x,0)=a_{0,0}+a_{1,0}x$ and $p(0,y)=a_{0,0}+a_{0,1}y$, these implications hold iff $a_{0,0}=a_{1,0}=a_{0,1}$. Consequently, this means that $p(x,y)=\sum_{m=1}^\infty\sum_{n=1}^\infty a_{m,n}x^my^n=xyQ(x,y)$, where $Q(x,y)$ is another polynomial.
Now, define
$$
{
M=\max\{m:p(x,y)=x^mQ(x,y)\ \ ,\ \ \text{$Q(x,y)$ is a polynomial.}\}\\
N=\max\{n:p(x,y)=x^nR(x,y)\ \ ,\ \ \text{$R(x,y)$ is a polynomial.}\}.
}
$$
Four cases are possible:

*

*$M$ and $N$ are odd.

*$M$ and $N$ are even.

*$M$ is odd and $N$ is even.

*$M$ is even and $N$ is odd.

We finish the proof by proving only the first case. The others follow similarly.
Assuming that $p(x,y)=x^My^NQ(x,y)$ for some odd positive integers $M$ and $N$, the expected property for $p(x,y)$ implies that $Q(x,y)$ must be negative only in the third quadrant, i.e. where $x<0$ and $y<0$. Therefore, a similar statement for $p(x,y)$, can be expolited for $Q(x,y)$ to prove that there exists an $R(x,y)$ such that $Q(x,y)=xyR(x,y)$. This conflicts with the definition of $M$ and $N$, as it implies that $M$ and $N$ were not the maximum powers of $x$ and $y$, resp. The other cases can be proved likewise and the proof is complete $\blacksquare$
