Taylor's theorem and estimating $|f'(x)|$ using $f$ and $f''$ I found a different solution to a problem about Taylor theorem, which is differ from the one introduced in my textbook. And I guess my solution is simpler than the one on the textbook, so I want to check whether there is a flaw on my work. The problem is:

A function $f:[0, 2]\to \Bbb R$ is twice differentiable, $|f(x)|\leq 1$ and $|f''(x)|<1$ for all $x\in[0, 2]$. Show that $|f'(x)|<2$ for all $x\in [0, 2]$.

And this is my work:

For any $x\in [0, 2]$ and $y(\neq x)\in [0, 2]$, by Taylor theorem, $$f(y)=f(x)+f'(x)(y-x)+\frac{f''(c)}{2}(y-x)^2$$ for some $c$ between $x$ and $y$. By hypothesis, $|f(x)|\leq1, \, |f(y)|\leq 1$ and $|f''(c)|<1$ and hence $$\begin{align} |f'(x)|&=\left|\frac{f(y)-f(x)}{y-x}-\frac{f''(c)}{2}(y-x)\right|\\[.4em] &\leq |f(y)-f(x)|\cdot \frac{1}{|y-x|}+\frac{|f''(c)|}{2}|y-x| \\[.4em] &<\frac{2}{|y-x|}+\frac{|y-x|}{2} \end{align}$$
From AM-GM inequality the latter one has the minimum value $2$ when $|y-x|=1$, and such $y$ exists for every $x\in [0, 2]$ thus $$|f'(x)|<\min\left\{\frac{2}{|y-x|}+\frac{|y-x|}{2}: x,\, y\in [0, 2], \; x\neq y\right\}=2,$$ which shows the requried result. ■

Thanks.

As mentioned in the comments, your approach only shows that $|f'(x)| < 4$.
The “trick” is to apply Taylor's theorem twice:
$$
 f(2) = f(x) + f'(x)(2-x) + \frac{f''(c)}{2}(2-x)^2 \\
 f(0) = f(x) + f'(x)(0-x) + \frac{f''(d)}{2}(0-x)^2
$$
and take the difference:
$$
 f(2)-f(0) = 2f'(x) + \frac{f''(c)}{2}(2-x)^2 -\frac{f''(d)}{2}x^2 \, .
$$
It follows that
$$
 2|f'(x)| \le |f(2)|+|f(0) | + \frac{|f''(c)|}{2}(2-x)^2+\frac{|f''(d)|}{2}x^2 \\
< 2 + \frac{(2-x)^2+x^2}{2} \le 4
$$
and therefore $|f'(x)| < 2$. Strict inequality holds because $|f''| < 1$, and $(2-x)^2$ and $x^2$ can not be simultaneously zero.
Remark: The technique is not new, it goes back (at least) to Edmund Landau in 1913, compare Find the supremum of the following set (differential inequalities).
