I am trying to understand smooth functions. My question is what is an example of a smooth function $f\colon\mathbb{R}\to\mathbb{R}$ such that $f(x)=0$ for all $x\leqslant-1$ and $x\geqslant1$, but $f(0)=1$?
And similarly, what about an example of a smooth function $f\colon\mathbb{R}\to\mathbb{R}$ where $f'(x)=-1$ for all $x\leqslant-1$ and $f'(x)=1$ for all $x\geqslant1$?

You just have to look for a function $$f(x)=0$$ on the interval $$(-\infty ,-1]\cup [1,\infty) $$ and extend it with continuity on $$(-1,1)$$ by imposing $$f(-1)=f(1)=0$$,$$f(0)=1$$ and $$f'(-1)=f'(1)=0$$.
Since $$f(x)=0$$ is continuous in $(-\infty ,-1]\cup [1,\infty) $ and also is its derivative, you just have to ensure to pick a function accordingly to the conditions above that is continuous on $$(-1,1)$$ with continuous derivative.
Similarly for second request you just have to find the proper function to extend with continuity your function in the interval $$(-1,1)$$