I want to verify the proof of this result I want to verify the proof of this result:
Lemma: Let $g$ be a real analytic function. Then we have ((1) and (2)) is equivalent to (3), where:
(1) $g$ has infinitely many real zeros.
(2) $g$ assumes arbitrarily large and arbitrarily small values, i.e., for all $K>0$, there are $s₁,s₂$ with $g(s₁)<-K$ and $g(s₂)>K$.
(3) The fiber $g⁻¹(w)$ is infinite for all $w∈ℝ$.
Proof: Firstely, assume by contraduction that the equation $g(s)=w$ has only finitely many solutions. That means there are $z₁<z₂$ such that $g(s)≠w$ for $w<z₁$ or $w>z₂$. Let $z₃$ be the largest zero of $g$ smaller than $z₁$, and $z₄$ the smallest zero larger than $z₂$. Let $K=max{|g(s)|:z₃≤s≤z₄}+|w|$. By assumption, there are $s₁,s₂$ with $g(s₁)<-K$ and $g(s₂)>K$. By the intermediate value theorem, there is an $s_{w}$ between $z₃$ or $z₄$ and $s₁$ or $s₂$ with $g(s_{w})=w$. Contradiction.
Secondly, $g$ has infinitely many zeros because the fiber $g⁻¹(0)$ is infinite. Let $K>0$ and $w=K+ε,ε>0$. The fiber $g⁻¹(K+ε)$ is nonempty because it is infinite, hence there is $s₂$ such that $g(s₂)=w=K+ε>K$. By the same method, $g⁻¹(-K-ε)$ is nonempty, so there is $s₁$ such that $g(s₁)=-K-ε<-K$.
Also, I want some start ideas to overcome the different steps of this proof.
 A: Your first paragraph is incorrect. 
Firstly, you probably meant that $g(s) \neq w$ for $s \not\in [z_1,z_2]$. 
Secondly, you proceeded to find some $s$ between $[z_1,z_2]$ such that $g(s) = w$. There is no contradiction with the first statement. 
Thirdly, going back to your definition of $z_3$ and $z_4$: those two numbers need not exist: at least you have not proven them to exist. Why must there be zeroes outside the closed interval $[z_1,z_2]$? 

Also, you have not proven the reverse implication (3) $\implies$ ((1) + (2)). 

Lastly, you must use somewhere the fact that $g$ is real analytic (which you have not used). An example: let 
$$ f(x) = \begin{cases} x-1 & x \geq 1 \\
0 & x \in (-1,1) \\
x+1 & x \leq -1 \end{cases} $$
Except for not being real analytic, this function satisfies condition (1) (it has infinitely many real zeros) and (2) (it assumes arbitrarily large and small values). But it most definitely does not satisfy (3). 
A: Lemma: Let $g$ be a real analytic function. Then we have the equivalence $((a)∧(b))⇔(c)$, where the statements $(a),(b)$ and $(c)$ are given by:
(a) $g$ has infinitely many real zeros and the set of those zeros is unbounded in both directions.
(b) $g$ assumes arbitrarily large and arbitrarily small values, i.e., for all $K>0$, there are $s₁,s₂$ with $g(s₁)<-K$ and $g(s₂)>K$,
(c) The fiber $g⁻¹(w)$ is infinite for all $w∈ℝ$.
Proof: (1) To prove that $(a)∧(b)⇒(c)$, assume by contraduction that the equation $g(s)=w$ has only finitely many solutions $(b_{j})_{1≤j≤i}$. That means there are $z₁<z₂$ such that $g(s)≠w$ for $w<z₁$ or $w>z₂$. Let $z₃$ be the largest zero of $g$ smaller than $z₁$, and $z₄$ the smallest zero larger than $z₂$. The exitence of $z₃$ and $z₄$ is guaranteed by item (a)and the fact that $g$ is analytic, so $g$ has only finitely many zeros in the compact interval $[z₁,z₂]$ (or $g$ is identically $0$, but that has been ruled out by the premise that it take arbitrarily large values), hence there must be infinitely many outside the interval. Let $K=max({|g(s)|:z₃≤s≤z₄})+|w|$. By assumption, there are $s₁,s₂$ with $ g(s₁)<-K$ and $g(s₂)>K$. By the intermediate value theorem, there is an $s_{w}$ between $z₃$ or $z₄$ and $s₁$ or $s₂$ with $g(s_{w})=w$. Contradiction.
We note that if $g$ is not analytic then it satisfies conditions (a) and (b) but does not satisfy (c). 
(2) To prove that $(c)⇒(a)∧(b)$, we note first that $g$ has infinitely many zeros because the fiber $g⁻¹(0)$ is infinite. This proves item (a). To prove item (b), let $K>0$ and $w=K+ε,ε>0$. The fiber $g⁻¹(K+ε)$ is nonempty because it is infinite, hence there is $s₂$ such that $g(s₂)=w=K+ε>K$. By the same method, $g⁻¹(-K-ε)$ is nonempty, so there is $s₁$ such that $g(s₁)=-K-ε<-K$.
