# Continuous functions with finitely many zeros

I was studying this question: Continuous map $$f : \mathbb{R}^2\rightarrow \mathbb{R}$$, where it is said that if a continuous function $$f(x)$$ from $$R^2$$ to $$R$$ has only finitely many zeros, then $$f(x)$$ greater equal to $$0$$ for all $$x$$ or $$f(x)$$ is less equal to zero for all $$x.$$ The solution given there is too big to think during time constraint exams so I have thought as below .

My Thought: I thought the function like $$f(x,y) = z$$, as the function is continuous the function will give a surface in $$R^3$$ now if the function is sometimes positive and sometimes negative it must pass through the $$x-y$$ plane Thus the surface intersects the $$x-y$$ plane making a curve on $$x-y$$ plane hence the function has got infinite zero contradicting the hypothesis of having finite zero. Is there any problem in my thinking?
btw I am totally new here and I am not used to with latex so sorry

• The difficulty is in justifying "Thus the surface intersects the x−y plane making a curve on x−y plane hence the function has got infinite zero contradicting the hypothesis of having finite zero" – Federico Dec 4 '18 at 17:54

You have a good idea, but it is not a solution yet. Suppose $$p,q \in R^2$$ and $$f(p)<0 Let $$\gamma:[0,1]\to \mathbb R^2$$ be a continuous curve with $$\gamma(0)=p, \gamma(1)=q.$$ Then $$f\circ \gamma$$ is a continuous function from $$[0,1]$$ to $$\mathbb R$$ such that $$f\circ \gamma(0)=f(p),$$ $$f\circ \gamma(1)=f(q).$$ By the intermediate value theorem, $$f\circ \gamma(c)=0$$ for some $$c\in (0,1).$$ Now there are infinitely many such paths from $$p$$ to $$q$$ that are pairwise disjoint except for the endpoints. Thus $$f$$ has infinitely many zeros in the plane.

• that is I have to show all paths from p to q intersects the plane at infinite points ...hence proving that the surface intersects the plane at infinite points – onlymath Dec 4 '18 at 18:07

There are simpler proofs in the second and fourth comments bellow the answer.

The proof of "sign change implies infinitely many zeros" can indeed be shortened: Suppose, without loss of generality, that $$f(−1,0)<0$$ and $$f(1,0)>0$$. By continuity of $$f$$, there is $$\delta > 0$$ such that $$f(−1,y)<0$$ and $$f(1,y)>0$$ for $$|y|<\delta$$. For each $$y$$ with $$|y|<\delta$$, the intermediate value theorem implies there is a zero of $$f$$ on the horizontal segment $$[−1,1]\times\{y\}$$.

– Andrew D. Hwang Dec 9 '13 at 13:02

I have a suggestion which might simplify the proof of $$f$$ changes sign $$\implies f$$ has infinitely many zeroes. Assume that $$f(x)<0$$ and $$f(y)>0$$. Then for every continuous path $$\phi_{xy}$$ starting at $$x$$ and ending at $$y$$ the continuous function $$f\circ\phi_{xy}$$ changes sign, and so it has a zero by the intermediate value theorem. (P.S.: I had overlooked the similar idea user86418 [Andrew] has submitted before me.)

– Giuseppe Negro Dec 9 '13 at 13:11

What you wrote isn't a proof, because it's not rigorous (how do you know that the intersection forms a curve? and what kind of curve (e.g. continuous)?) To turn your idea into a proof you want to do something like in Giuseppe's comment (and zhw.'s answer).

Andrew's comment gives you explicit paths from $$x$$ to $$y$$. Namely, you go straight up, straight across and then straight down.

P.S. It is not clear what form the set $$f^{-1}(0)$$ should take. The case we are most used to is where we get a curve but it is also possible for a function to be flat on a 2 dimensional set. For example

$$f(x,y) = \begin{cases} 0 & x^2 + y^2 \le 1 \\ x^2 + y^2 - 1 & \text{otherwise} \end{cases}.$$

• Andrew also said about horizontal paths from f(-1,y) to f(1,y) just like @zhw ? – onlymath Dec 4 '18 at 18:12
• @onlymath Andrew's paths go from $(-1,0) \to (-1,y) \to (1,y) \to (1,0)$ in straight lines. – Trevor Gunn Dec 4 '18 at 18:13
• "but since f(x,y) is a continuous curve" f is a function whose graph is a surface. "it must make a curve on passing through a plane" no, I just showed you can get a 2-dimesnional set. "be it continuous curve or not in R^2 ? (as the infinte number of disjoint paths on the surface passes through R^2)" what??? – Trevor Gunn Dec 4 '18 at 18:32
• srry I was thinking too much that it messed up srry – onlymath Dec 4 '18 at 18:38