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?
 A: This depends very specifically on the setup of the problem.
If the problem is

For $f(x) = \max\{ \sin x, \cos x\}$ with domain $(0,2\pi)$, find all the critical points.  (Or "... find the local/global extrema."),

the endpoints would be critical points, but you have a problem.  The function is not defined at the endpoints, so you cannot evaluate the function there, so these are not critical points.  In fact, a global maximum of $f$ would occur at both endpoints, but $f(x)$ only attains the global maximum at $x = \pi/2$.  In some settings, it is appropriate to say "the values of $f(x)$ approach the maximum at the endpoint, but do not attain the maximum", meaning that the limit of $f$ as we approach the endpoint is the same as the global maximum on its domain.
If the problem is

For $f(x) = \max \{\sin x, \cos x \}$, find all the critical points on the interval $(0,2\pi)$ (Or "... find the local/global extrema."),

the endpoints are critical points because the function is differentiable there.  However, you discard them because the endpoints are excluded.  (This is why most of your optimization theorems require closed intervals.)
Generally, the function will not have critical points at the endpoints (regardless whether the endpoints are included in the interval).  But neither the function nor its derivative know about the externally applied restriction to the interval, so you must remember to check the endpoints of the interval yourself.  The easiest example of this is any non-constant line on any kind of interval.  Lines have no critical points, but their extrema are on the boundaries of the interval.  At an open endpoint, the line only takes the extreme value in the limit as the argument approaches the endpoint.  At a closed endpoint, the line takes the extreme value at the endpoint.
A: $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.
