"Intermediate Value Theorem" for curves Let $f$ be a continuous real function defined on the unit square $[0,1]\times[0,1]$, such that $f(x,0)=-1$ and $f(x,1)=1$.
If we walk from $y=0$ to $y=1$ on any path, we must cross some point where $f=0$. Intuitively, there is a connected "wall" (a curve) that separates $y=0$ from $y=1$, on which $f=0$, like this:

My question is: is there a theorem that formalizes this intuition (if it is correct)?  In particular: is there a theorem which implies that there exists a connected line that goes from $x=0$ to $x=1$, on which $f=0$, as in the picture?

Converting my comment to a loose idea of proof:
Assume it's not true - ie, the set of zeros of f is not connected between x=0 and x=1. Then there are 2 disjoint open sets, A and B, one containing the x=0 side, and the other one containing the x=1 side, which cover the entire set of zeros.
Now let's prove that in the remaining piece of the square not covered by either A or B there is a connected component touching both y=0 and y=1. This would contain a path where f is non-zero (well, not exactly a path, but it would kind of break the notion of 'every connection between the two sides must equal zero somewhere'). Again, let's assume otherwise, so there are 2 disjoint open sets, C and D, one containing y=0, the other one containing y=1, which cover the remaining part of the square.
Now we prove that the boundaries of A and C, $\partial A$ and $\partial C$ intersect - with some hand-waving, the connected component of A containing the entire x=0 side has points both in the interior of C: (0, 0), and points in the interior of the complement of C: (0, 1), and since it's connected, it must also have points on the boundary of C, and the limit points of these will still be on the boundary of C, but will also be on the boundary of A. Now look at a single point $x \in \partial A \cap \partial C$. It is not inside A or C, since they are open, but it also cannot be in B or D. For example, if we assume $x \in B$ then there is an open neighborhood of x fully contained in B, and therefore disjoint from A, which is a contradiction with $x \in \partial A$. So x is not in $A \cup B \cup C \cup D$, which is a contradiction, we assumed that those 4 sets cover the square.
