# Existence of zero using definition of limit

Suppose $a$ and $b$ are two real numbers with $a<0$ and $b>0$, and $f$ is a continuous function with $\lim_{x\to +\infty} f(x)= b$ and $\lim_{x\to -\infty} f(x)= a$. How can I prove that the equation $f(x)=0$ has at least one solution in $\mathbb{R}$ using the definition of the limit?

-

If $\lim_{x\to\infty}f(x)=b>0$, then there is some $N\in R$ such that $x>N$ implies $$\frac12 b=b-\frac12 b<x<b+\frac12 b=\frac32 b.$$ Hence there is some $r>0$ with $f(r)>0$.
If $\lim_{x\to-\infty}f(x)=a<0$, then there is some $M\in R$ such that $x<M$ implies $$\frac32 a=a+\frac12 a<x<a-\frac12 a=\frac12 a.$$ Hence there is some $p<0$ with $f(p)<0$.
Now $f$ is continuous and $f(p)<0<f(r)$, so by the intermediate value theorem, there is some $q\in R$ with $p<q<r$ and $f(q)=0$.