A question on a Lipschitz function This is the problem:
Prove or disprove the following statement:
If $f:[0,+\infty]\rightarrow\mathbb{R^+}$  is a Lipschitz function and not bounded, then it has necessarily $\lim_{x\to+\infty} f(x) = +\infty$
 A: Let
$$
T(x)=1-2\,|1-x|,\quad 0\le x\le1
$$
be the tent function. Now define $f$ as $f(x)=0$ if $0\le x\le1$ and
$$
f(x)=2^nT(2^{-n}(x-2^n))\quad \text{if}\quad 2^n\le x\le2^{n+1}.
$$

$f$ is Lipsthitz with constant $2$, unbounded, and $f(2^n)=0$ for all $n$, so that $f(x)\not\to\infty$. If you want $f$ to be strictly positive, just take $f(x)+1$.
A: Here's a rather synthetic example:
$$f(x) = \begin{cases}
 \phantom{-}0 & 0 \leq x \leq 1 \\
 \phantom{-}2(x - 1) & 1 \leq x \leq 2 \\
 -2(x - 2) + 2 & 2 \leq x \leq 3 \\
 \phantom{-}2(x - 3) & 3 \leq x \leq 6 \\
 -2(x - 6) + 6 & 6 \leq x \leq 9 \\
 \phantom{-}\dots & \\
 \phantom{-}2(x - 3^n) & 3^n \leq x \leq 2\cdot 3^n \\
 -2(x - 2\cdot 3^n) + 2\cdot 3^n & 2\cdot 3^n \leq x \leq 3^{n + 1}
\end{cases}$$
If I got my numbers right, this should move in a sawtooth manner between $y = 0$ and $y = x$ with slope $\pm 2$, and is thus an unbounded Lipschitz function with positive values.  It suggests the following smooth version:
$$g(x) = x \sin^2 (1 + x)^{-1/3}.$$
We have
$$g'(x) = \sin^2 (1 + x)^{-1/3} - \frac{1}{3} x(1 + x)^{-4/3} \sin 2(1 + x)^{-1/3},$$
which is bounded, so $g$ is Lipschitz, and $g$ is unbounded since $\sin^2 (1 + x)^{-1/3} \sim (1 + x)^{-2/3}$ as $x \to \infty$, which is overpowered by the factor of $x$.
I consider the synthetic example more convincing than the smooth example, despite the compactness of the formula.  It demonstrates that even if you can't find an example, it is possible to construct one by imagining how it would look; as the now-deleted previous answers demonstrate, it can be rather tricky to get a "simple" formula to work out calculus-wise.
