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