Prove that $f$ has a minimum 
Let $f$ be a positive and continuous function in $[0,\infty)$, such that $\lim\limits_{x\to \infty} f(x)=2$.
Prove that if $f(0)<2$, $f$ has  a minimum in  $[0,\infty)$.

I am stuck in the final step, in my opinion.
From the limit's definition, there is $M \in \Bbb R$ such that for every $x>M$, $|f(x)-2| < \varepsilon$
In the closed interval, $[0,M]$, the function has a minimum, according to Weierstrass theorem.
I have to prove that it is the global minimum. It won't be a global minimum if there is some $x_0>M$ which is a minimum. I think that's where I have to reach a contradiction which I can't formalize.
Thanks for you help.
 A: HINT: You need to choose $\epsilon$ small enough to guarantee that the minimum on $[0,M]$ is in fact the global minimum. I.e., you need to choose $\epsilon$ small enough so that you know $f(x)\le 2-\epsilon$ for some $x\in [0,M]$.
A: Assume $f(0) = 2-2\epsilon$ for some positive $\epsilon$, then there is an $M>0$ such that
$$x\geq M \Rightarrow |x-2|\leq \epsilon$$
According to Weierstrass, there is a minimum in $[0,M]$. This is also the global minimum, since
$$f([M,\infty))\subseteq [2-\epsilon,2+\epsilon],\ 2-2\epsilon\in f([0,M]).$$
A: Note that in your formula, for $\varepsilon=2-f(0)>0,$ it exists $M\in\mathbb{R}$ such that $$\forall x\in[0,+\infty),x\geq M\implies |f(x)-2|\leq 2-f(0),$$ which implies $f(0)-2\leq f(x)-2\leq2-f(0)$ and so $f(0)\leq f(x).$ Now note $m$ the minimum of $f$ on $[0,M]$ which exists according to Weierstrass theorem, and as $m\leq f(0)\leq f(x)$ for $x\geq M,$ then $m$ is your global minimum.
A: hint
Let $t\in ]f(0),2[$. Since $\lim_{x\to \infty }f(x)=2$, there is $M$ s.t. $f(x)>t$ for all $x>M$. The rest follow... 
A: Hint
Since $\lim\limits_{x\to \infty} f(x)=2$ there exists $M>0$ such that 
$$x>M \implies |f(x)-2|<\min\{\frac{2-f(0)}{2},1\}(>0).$$ Now, on $[0,M]$ the function $f$ has a global minimum $x_0.$ This is the global minimum, because if $x>M$ it is
$$f(x)>f(0)\ge f(x_0).$$
