Show such a function has a maximum Let $f:[0, \infty)$ be a continuous function.
$f(0) = 1 $ and $\forall x \in [0, \infty)$ $f(x)\leq \frac{x+2}{x+1}$ 
Show that $f$ gets a maximal value in $[0, \infty)$.
My intuition:
if $f(0)$ is the maximum i'm done if not the function you showed me converges to $1$ I want to show that from a certain point it will be lower than $1.$ Can you help me formalize it?

Assume that $\sup_{x\geq 0}f(x)>1$ and that the maximum does not exist. Then there is a sequence $(x_n)_{n\in\Bbb N}$ in $[0,\infty)$ (wlog monotonically increasing) such that $f(x_n)\to\sup_{x\geq 0}f(x)$ for $n\to\infty$. Furthermore, the sequence $(x_n)_{n\in\Bbb N}$ can be chosen as $x_n\to\infty$ (otherwise the sequence were contained in a compact set $K$ and (because of monotonicity) it would converge to a $x_0\in K$, which is necessarily the maximum of $f$ on $K$ (because of continuity) - that is a contradiction to the assumption).
Now we obtain
$$1<\sup_{x\geq 0}f(x) = \lim_{n\to\infty}f(x_n) \leq \lim_{n\to\infty}\frac{x+2}{x+1} =1,$$
which is a contradiction. Therefore the assumption was wrong and the maximum exists or $\sup_{x\geq 0}f(x)=1$ holds. But then with $f(0)=1$ the maximum exists, too.
