I have a feeling that the following must be true, but I cannot figure out a proof.
I have two real analytic functions, $f$, $g$, both $[0,1]^2\rightarrow\mathbb{R}$. I am interested in the set for which $f(x,y)=g(x,y)=0$. Specifically, I would like to prove that this set is zero-dimensional. I know the following about these functions:
For every $x_0 \in [0,1]$, $f(x_0,y)=0$ has a solution.
There exists $\epsilon \in(0,0.5)$ so that $g(x_0,y)=0$ has solutions only for $x_0\in [\epsilon,1-\epsilon]$.
Conversely, for every $y_0 \in [0,1]$, $g(x,y_0)=0$ has a solution.
There exists $\epsilon \in(0,0.5)$ so that $f(x,y_0)=0$ has solutions only for $y_0\in [\epsilon,1-\epsilon]$.
To put it into words, close to the boundary of the domain in $x$-direction, $f$ has zeros but $g$ does not. Close to the boundary in $y$-direction, $g$ has zeros but $f$ does not.
This of course implies all solutions to the system are in the interior.
My questions are:
a) Is the information sufficient to conclude that solutions to $f=g=0$ are isolated points, i.e. there cannot be higher dimensional zero sets for the system? How would one show this?
b) If it is false, what would be a counterexample?
c) If it is true, is it also true for higher dimensions, say 3 functions $f,g,h:[0,1]^3\rightarrow\mathbb{R}$ with
$f,g$ having zeros near and at $x=0,x=1$, but not $h$,
$f,h$ having zeros near and at $y=0,y=1$, but not $g$,
$g,h$ having zeros near and at $z=0,z=1$, but not $f$.
Again the zero set for the system must lay in the interior. Can it contain paths?
Any help is highly welcome.
edit: I'll try to add a bit of thought we've had here.
If the solution set does contain a path, this path can not be parallel to either the $x$- or $y$-axis - for then one could apply the identity theorem, and the restriction of both functions to that parallel would have to be the zero function. This contradicts either function not having a solution close to the boundaries this parallel intersects.
So then, if such a path exists, it must be possible locally to give a parametrization of one coordinate by the other, say $\bar x(y)$, with $f(\bar x(y),y)=g(\bar x(y),y)=0$ for $y$ in some open interval. But I fail to derive a contradiction from that and the assumptions quite yet.
edit2: H. H. Rugh's answer and other users in the comments have pointed out how to construct counterexamples by taking any $f,g$ with the described properties and then multiplying both by some $h$ that has a 1-dimensional zero set in the interior. That was very helpful, since I realize now that the information described above is not sufficient to conclude what I wish to conclude (i.e. isolated zeros only). However, I am still convinced that it holds for the system I am interested in, but I obviously will have to rethink how to approach it.
Any hints regarding which properties might be helpful to establish that such a system allows only isolated solutions would be highly welcome.
When $f$ and $g$ are real-analytic then their common zero-set may consist of isolated points but also 1 dimensional curves and (in suitable local coordinates) algebraic curves. Take a solution $f$ and $g$ to the problem you state and multiply both $f$ and $g$ by e.g. $h(x,y) = (x-1/2)^2+(y-1/2)^2=1/16$. Then $fh=gh=0$ will have your original solutions with a circle well inside the square added to the zero-set.
In higher dimensions you may in the same way add e.g. a sphere to a common zero set of the original problem. There are, however, limitations, coming from real-analyticity, to what you may add. For example, you may not have a sequence of isolated zeroes accumulating to some point (at which $f$ and $g$ are real-analytic).