Let $f(x)$ be a nice/$C^{\infty}$ function of some real-variable $x$ which satisfies the inequality $$ |f'(x)| \leq 1\ \ \ \ \ \ \ \mathrm{for\ all\ }x>0 $$ If this is true, does this imply that $$ |f(x)| \leq |x| \ \ \ \ \ \ \ \mathrm{for\ all\ }x>0? $$ Or something similar? This seems to follow by ``integrating both sides''. I've come up with some functions where this seems to be the case (for example $f'(x) = \tanh(x)$ satisfies $|f'(x)| \leq 1$, and $f(x) = \log(\cosh(x))$ satisfies $|f(x)| < |x|$).
If this is true, how can you prove it?
If this is not true, what is an example of a counter-example?
To elaborate a bit: the condition $$ |f'(x)| \leq 1\quad\text{ for all } x>0 $$ does not imply any bound on $f$ because $f$ can be shifted by a constant and the derivative does not change. For example, we could shift $f$ up by $100$, down by $1000$, and so on, and the derivative would not change.
A concrete counterexample is given in the comments: if $f(x) = 1000$, then $|f'(x)| = 0$ so it is bounded by $1$, but $|f(x)|$ is not bounded by $|x|$.
So, if you want the bound on $|f(x)|$, you need to additionally specify something like $f(0) = 0$. In general, the best bound you can have is $$ |f(x)| \le |x| + |f(0)|, $$ which follows by Traingle inequality from Martin's answer.
P.S.: A particular consequence of the bound on the derivative $|f'(x)| \le 1$ that your function $f$ is Lipschitz continuous with constant $1$.