minimum/maximum of two limits Let $f: \mathbb {R} \rightarrow \mathbb {R} $ continuous so that $v =\lim\limits_{x \rightarrow -\infty} f(x) $ and $w = \lim\limits_{x \rightarrow \infty} f(x)$ are existing.
I want to show that 
(i) f is bounded on $\mathbb{R}$
(ii) If $v=w$, then $f$ has a minimum or a maximum in $\mathbb {R}$
How to start this?
 A: Hint for (i): Choose an $N$ large enough that $f$ is close to $v$ on $(-\infty, -N)$ and close to $w$ on $(N, \infty)$. Now notice that $[-N, N]$ is compact.
For (ii), a similar argument works, provided that $f$ isn't constant.
A: I will prove that if $f$ is continuous on $[0,\infty)$ and $\lim_{x\to\infty}f(x)=w$, then $f$ is bounded.
Let $\epsilon=1$. There exist $x_0$, such that $x_0>0$ and for every $x>x_0$ we will have $|f(x)-w|<1$, thus, $w-1<f(x)<w+1$ for every $x>x_0$. Now, let us look at $f(x)$ on closed interval $[0,x_0]$. By  the boundedness theorem the function is bounded in that interval. Thus, there exist $L$ and $M$ such that $L \leq f(x)\leq M$ for every $x\in[0,x_0]$. Let $\bar{L}=\min\{w-1,L\}$ and $\bar{M}=\max\{w+1,M\}$. It is clear that $\bar{L} \leq f(x)\leq \bar{M}$ for every $x\in[0,\infty)$.
Try to show, like I did, that if $f$ is continuous on $(-\infty,0]$ and $\lim_{x\to -\infty}f(x)=v$, then $f$ is bounded.
Then you will get bounds $\bar{T}$ and $\bar{S}$ of $f(x)$ on $(-\infty,0]$, i.e., $\bar{S}\leq f(x)\leq\bar{T}$ for every $x\in(-\infty,0]$.
If you choose, $B=\min\{\bar{S},\bar{L}\}$ and $D=\max\{\bar{S},\bar{M}\}$, then $B\leq f(x)\leq D$ for all $x\in\mathbb{R}$
