Suppose this is not true. Then there exists $x_0 \in (0, 2)$ with $|f'(x_0)| > 2$. (Some continuity argument might be needed here to justify the exclusion of $0$ and $2$ from our consideration.)
Without loss of generality, we can assume $f'(x_0) > 2$.
From the fundamental theorem:
\begin{align}
f(x) & = f(x_0) + \int_{x_0}^x f'(\xi) \,d\xi \\
f(x) - f(x_0) & = \int_{x_0}^x \left(f'(x_0) + \int_{x_0}^{\xi} f''(\eta)\,d\eta\right) \,d\xi \\
f(x) - f(x_0) & = (x - x_0)f'(x_0) + \int_{x_0}^x \int_{x_0}^\xi f''(\eta) \, d\eta \, d\xi.
\end{align}
For $y \in (x_0, 2]$,
\begin{align}
f(y) - f(x_0)
& = (y - x_0)f'(x_0) + \int_{x_0}^{y} \int_{x_0}^{\xi} f''(\eta)\, d\eta\,d\xi \\
& > 2(y - x_0) + \int_{x_0}^y \int_{x_0}^{\xi} (-1) \, d\eta \, d\xi \\
& = 2(y - x_0) - \frac 12(y - x_0)^2. \tag{1}
\end{align}
Similarly, for $x \in [0, x_0)$, we have
\begin{align}
f(x) - f(x_0)
& = -(x_0 - x)f'(x_0) + \int_x^{x_0} \int_{\xi}^{x_0} f''(\eta)\, d\eta\,d\xi \\
& < -2(x_0 - x) + \int_x^{x_0} \int_{\xi}^{x_0} (1)\, d\eta\,d\xi \\
& = -2(x_0 - x) + \frac 12(x_0 - x)^2. \tag{2}
\end{align}
Subtract $(2)$ from $(1)$:
\begin{align}
f(y) - f(x) & > 2(y - x) - \frac 12(y - x_0)^2 - \frac 12(x - x_0)^2 \\
& = 2(y - x) - \frac 12(y - x)(y + x - 2x_0).
\end{align}
If we choose $x = 0$ and $y = 2$, this inequality becomes
$$
f(y) - f(x) > 2(2) - \frac 12(2)(2 - 2x_0) = 2 + 2x_0 > 2.
$$
This implies $|f(x)| > 1$ or $|f(y)| > 1$ (or both), contradicting the assumption.