$f$ continuous s.t $|f|$ increasing and $|f|\le x$ then $f$ unifrmly continuous

Let $f$ be a continuous function such that $|f(x)|$ is increasing and $|f(x)|\le x \ \forall x \in [0,\infty)$. Is $f$ uniformly continuous on $[0,\infty)$?

What I think is that I can bound the difference $|f(x)-f(y)|\le |x-y|$ $\forall x,y \in \Bbb{R}$. This would imply that $f$ is 1-Lipschitz on $\Bbb{R}$ and so uniformly continuous. I'm not really sure about this. If someone could help, I would really appreciate it. Thank you in advance


The answer is no. Remark that, up to change a sign, you are asking if an increasing function which graph is below the graph of the straight line $y=x$ is necessarely uniformly continuous.

Remark that if $g$ is a function satisfing the hypothesis, then $g_t(x):=g(x-t)+t$ does it, too, $\forall t\ge0$, except from the fact it is not defined over $[0,+\infty)$ but over $[t,+\infty)$.

Consider the family of function $f_{n}\colon[0,n]\to[0,n]$, $n\ge1$, defined as it follows: \begin{align} f_{n}(x)=\begin{cases} 0 & x\in[0,n-1]\\ n(x-n+1) & x\in[n-1,n] \end{cases}. \end{align} It is clear that $f_{n}$ satisfies the hyoothesis $\forall n\in\mathbb N$

Hence, define $f(x):=f_{n}(x-t_{n})+t_{n}$, $t_n={n\choose 2}$, that is you define $f$ by joining continuously the $f_{n}$. By the remark, $f$ satisfies the hypothesis, but it is clear that it is not uniformly continous: in fact it is smooth except for $$x={n\choose2}-1,{n\choose2},\qquad n\ge1,$$ and where differentiable, the derivative tends to $+\infty$ as $x$ grows.Graph of the function