Give an example of smooth function $f:\mathbb{R}\to\mathbb{R}$ such that
supp $f=[0,1]$ and $|f'(x)|\leq1$ for all $x$.
Give an example of smooth function $f:\mathbb{R}\to\mathbb{R}$ such that
supp $f=[0,1]$ and $|f'(x)|\leq1$ for all $x$.
Take your favorite smooth function $g$ which is supported on $[0,1]$.
$|g'|$, being continuous on $[0,1]$, will be bounded. Let $M$ be such a bound. Consider now $f:=\frac{g}{M}$.
If you want an explicit example, just pick a particular $g$ and follow the procedure.
This type of functions are to be constructed. for example $$f(x)=\left\{ \begin{array}{ll} e^\frac{-1}{1-x^2} , & \hbox{$ |x|\leq$ 1;} \\ 0 , & \hbox{otherwise} \end{array} \right.,$$ Using the fact that $e^\frac{-1}{x^2}$ approches $0$ when x approches $0.$ $\sin x, \cos x$ can also be used to construct this type of functions.