Find a mistake in the following bogus proof Theorem: The function $f:\mathbb{R} \rightarrow [-10,10]$ defined by $f(x) = \cos(x)+\sin(x)$ for all $x \in \mathbb{R}$ has no maximum or minimum on ($-\infty,+\infty$)

Proof: The function is differentiable on $\mathbb{R}$ so one should be able to find its extrema by setting the derivative to 0. In particular, $$(\sin(x)+\cos(x))' = 0$$
$$\cos(x)-\sin(x) = 0$$
$$\sin(x) = \cos(x)$$
$$\sin(x+\pi/2) = \sin(x)$$
$$x+\pi/2 = x.$$

And the final equation is never true.
Yet WolframAlpha disagrees with my conclusions...
The problem is that 
$$
\sin(\pi/2 +x) = \sin(x)
$$
does not imply that
$$
x+\pi/2 = x.
$$
This would only be true if $\sin$ was one-to-one on the interval considered.
The function is continuous and periodic, so by Bolzano Weierstrass it must have a maximum and a minimum.