Are endpoints critical points? In the function $f(x)=\max\{\sin (x),\cos (x)\}$ for all $x$ belonging to $(0,2π)$ , can we count end points of the domain as critical points, since a function is not differentiable at endpoints?

$f(x)=max(\sin x, \cos x) \implies f(0)=1$ and $f'(0)=-\sin 0=0$ which is finite.
Next, $f(2\p1)=1$ and $f'(2\pi)=\sin(2 \pi)=0$, which again is finite. So $f'(0$ and $f'(2\pi)$ being finite, $f(x)$ at these end points is differentiable.
