Do the end points of a domain come under critical points? I know we say critical point is a point where the derivative is zero or the derivative doesn't exist.
For example: $$ f:[0,\pi] \to [-1,1], f(x) = \sin(x).$$ Does this have 1 critical point or 3 critical points (0 and $\pi$ included) ?
NOTE: This question is limited to only Single Variable Functions. Although I really would love an insight to this for Multivariable as well.
Edited
$$f'(x) = \cos(x) = 0 \iff x = \frac{\pi}{2}$$ The function $f$ has three critical points.
Since the other answer has elaborated on OP's understanding on the definitions using the differentiability of $f$, there's no point repeating its arguments. Instead, I'll cite from a university course web page to show why we need to include the endpoints of the domain of $f$ if $f$ is defined at those points. By doing so, we learn the definitions by heart instead of by memory.
Source: © CalculusQuest™
As @mathcounterexamples.net points out in Can critical points occur at endpoints? E.g. $f(x) = \frac{1}{x}$ at the interval $[1,4]$, the definition of critical points can vary. Although OP's definition comes from Wikipedia's page on critical points, it actually originates from p.84 of Demidovǐc and Baranenkov's Problems in mathematical analysis.
Example 5 in p.86 seems contradictory to what we've known.
Edited again: As @MichaelRybkin points out, the author actually means the greatest and least values on $[-1\frac12, 2\frac12]$ of $y: \Bbb{R} \to \Bbb{R}$ defined by $y = x^3 - 3x + 3$.
Final remark: Personally, I prefer © CalculusQuest™'s definition, which includes the endpoints of the domain since that makes much more sense with our goal.