Show that limit of the zero set is in the zero set I'm having some trouble proving the following:

Let $I=[a,b]$ and let $\,f:I\to\mathbb{R}$ be a continuous function on $I$ such that for each $x\in I$ there exists $y$ such that $|f(y)|\leq\frac{1}{2}|f(x)|$. Prove there exists a point $c\in I$ such that $f(c)=0$.

Here is my attempt:
Since $a\in I$, we have that there exists a $y'$ such that $|f(y')|\leq\frac{1}{2}|f(a)|$. Also, since $b\in I$, we have that there exists a $y''$ such that $|f(y'')|\leq\frac{1}{2}|f(b)|$. Rewriting, we have the two inequalities: 
$$-\frac{1}{2}f(a)\leq f(y')\leq\frac{1}{2}f(a)\tag{1}$$
$$-\frac{1}{2}f(b)\leq f(y'')\leq\frac{1}{2}f(b)\tag{2}$$
Without loss of generality, suppose that $f(y'')\leq f(y')$. Putting (1), (2) together gives $$-\frac{1}{2}f(b)\leq f(y'')\leq\frac{1}{2}f(a).$$ Letting $g(x)=\frac{1}{2}f(x)$, we have $$-g(a)\leq f(y'')\leq g(b).$$ My thought process here is to somehow apply the Bolzano Intermediate Value Theorem which states that if $f(a)<k<f(b)$ then there exists a $c$ between $a$ and $b$ such that $f(c)=k$. Here $k=f(y'')$. So evidently, there exists some $c$ such that $g(c)=\frac{1}{2}f(c)=f(y'')$, but around here is where I get confused. I'm not sure how to get the result $f(c)=0$ for some $c\in(a,b)$ from this. Any help would be appreciated.
 A: Let $J$ be the image of $I$ under $f$.  Since $I$ is a closed interval, and $f$ is continuous,  $J$ must also be a closed interval.    If $0$ is not in $J$, then either $J$ is entirely positive or entirely negative.  If $J=[c,d]$ with $c>0$, then we get a contradiction by choosing $x\in I$ with $f(x)=c$ and applying the hypothesis to get $y\in I$ with $|f(y)|<|f(x)|=c$.  The case of $J$ entirely negative is similar.
A: Construct a sequence $(x_n)$ the following way:


*

*start with $x_0=a$,

*choose $x_1$ to be such that $|f(x_1)|\leq\frac{1}{2}|f(x_0)|$,

*$\dots$

*choose $x_n$ to be such that $|f(x_n)|\leq\frac{1}{2}|f(x_{n-1})|$,

*$\dots$
Note that $|f(x_n)|\leq\frac{1}{2^n}|f(a)|$ by induction. Since $(x_n)$ is a sequence of elements of $[a,b]$, which is closed and bounded, you can extract a convergent subsequence $(\tilde{x}_n)$. We denote $\tilde{x}_\infty$ its limit. Then, by continuity of $f$ and $|\cdot|$,
$$|f(\tilde x_\infty)|=|f(\lim_{n\to\infty}\tilde{x}_n)|=\lim_{n\to\infty}|f(x_n)|\leq\lim_{n\to\infty}\frac{1}{2^n}|f(a)|=0,$$
so $f(\tilde{x}_\infty)=0$ and $\tilde{x}_\infty$ is an element that you are looking for. 
