Suppose that $f$ is differentiable on $\mathbb{R}$. If $f(0)=1$ and |f^{'}(x)|\leq1 for all $x\in\mathbb{R}$, prove that $|f(x)|\leq|x|+1$ for all $x\in\mathbb{R}$.
I tried:
Let $g(x)=|f(x)|-|x|-1$. Then I tried to find g^{'}(x) but I'm not sure where to start.