Given a continuous function such that $\lim_{x \to \infty} |f(x)| = 1$, prove that $\lim_{x \to \infty} f(x) = 1$ or $\lim_{x \to \infty} f(x) = -1$ Let $f$ be a continuous functions in $\mathbb R$ so that $\lim_{x\to\infty}|f(x)|=1$.  Prove that $\lim_{x\to\infty}f(x)=1$ or $\lim_{x\to\infty}f(x)=-1$.
Hint: First, prove that $\exists N>0~\forall x>N,f(x)\neq 0$ 
Tried all kind of things, with $M-\varepsilon$ definition, but haven't managed to figure this one out.
Would appreciate any help.
 A: By hypothesis, there is $M$ such that $\lvert f([M,+\infty))\rvert\subseteq \left(\frac12,\frac32\right)$. Equivalently, $$f([M,+\infty))\subseteq \left(-\frac32,-\frac12\right)\cup\left(\frac12,\frac32\right)$$
By the intermediate value theorem, the image of an interval under a continuous map is an interval. Therefore either $f([M,+\infty))\subseteq \left(-\frac32,-\frac12\right)$ or $f([M,+\infty))\subseteq \left(\frac12,\frac32\right)$.
In the first case, $1=\lim_{x\to\infty} \lvert f(x)\rvert=\lim_{x\to\infty}-f(x)$. In the second case, $1=\lim_{x\to\infty} \lvert f(x)\rvert=\lim_{x\to\infty} f(x)$.
A: Assuming the hint, i.e. there is some $N$ such that when $x > N$, we have $f(x) \neq 0$. From this we can prove that either $f(x) < 0$ or $f(x) > 0$ when $x > N$; suppose not, then there are $x, y > N$ such that $f(x) < 0 < f(y)$, and by the intermediate value theorem, there would be some $z$ between $x$ and $y$ such that $f(z) = 0$.
Assume without loss of generality that $f(x) > 0$ for $x > N$.
The only candidate for the limit is 1, and I think the argument can be finished from here easily.
A: For any $\epsilon >0$ there is $M>0$ such that $\left||f(x)|-1\right|<\epsilon$
Suppose $f(x)>0$.
We have $|f(x)|=f(x)$ so $\left|f(x)-1\right|<\epsilon$ so $\lim_{x\to \infty } \, f(x)=1$
If $f(x)<0$ then $|f(x)|=-f(x)$ and we have $\left|-f(x)-1\right|<\epsilon$ which is $\left|f(x)+1\right|<\epsilon$ which means $\left|f(x)-(-1)\right|<\epsilon$ or, in other words, $\lim_{x\to \infty } \, f(x)=-1$.
A: Hint
If the limit exist, it must be $\pm 1$ (why). So let prove that it doesn't exist. The only case we have to consider is if there are $(x_n)$ and $(y_n)$ s.t. $x_n,y_n\to \infty $ and $$\lim_{n\to \infty }f(x_n)=-1\quad \text{and}\quad \lim_{n\to \infty }f(y_n)=1.$$
I let you argument why. And this will give you a contradiction with the continuity of $f$. Indeed, using intermediate value theorem, you will be able to construct a sequence $(z_n)$ s.t. $f(z_n)=0$ for all $n\geq N$ from a certain rank $N$. And this will contradict $\lim_{n\to \infty }|f(z_n)|=1.$
A: First of all, there exists $k$ such that, for $x>k$, $|f(x)|>0$ (prove it).
I claim that there exists $M$ such that, for $x\ge M$, $f(x)$ has the same sign as $f(M)$.
If $Z(f)$ is not empty, let $M'=\sup Z(f)$. Note that $Z(f)$ is bounded above by $k$, so $M'\le k$. Define $M=M'+1$; then $M\notin Z(f)$ and so $f(M)\ne0$.
If $f(M)>0$, then $f(x)>0$, for every $x>M$. Otherwise there would exist $x_0>M$ with $f(x_0)=0$, by the intermediate value theorem, which is a contradiction to $M>M'$.
Similarly, if $f(M)<0$, then $f(x)<0$, for every $x>M$.
Now conclude using the fact that
$$
\lim_{x\to\infty}|f(x)|=
\lim_{\substack{x\to\infty\\x>M}}|f(x)|
$$
There is also the case $Z(f)=\emptyset$ to take care of, but it's easy (again by the intermediate value theorem).
