An endpoint of a closed interval where the derivative is zero is considered a critical point? Consider the function $f(x)=x-\sin(x)$. I want to find the critical points of $f(x)$ on $[0,2\pi]$. Since $f'(x)=1-\cos(x)$ then the equations $f'(x)=0$ for $x\in [0,2\pi]$ gives two solutions $x_1=0$ and $x_2=2\pi$. My question is about considering $x_1=0$ and $x_2=2\pi$ as critical points.
The definition from Paul Dawkins's Calculus 1  is not specific about considering endpoints as critical points even if the derivative is zero at the endpoint:

We say that $x=c$ is a critical point of the function $f(x)$ if $f (c)$ exists and if either of the following
are true : $f'(c)=0$ or $f'(c)$ doesn't exist.

So as you see the author does not specify if $c$ must be an interior point or if it can be an endpoint of a closed interval like the example we have here.
I'm confused because he added later:

There is no reason to expect
end points of intervals to be critical points of any kind. Therefore, we do not allow relative extrema to
exist at the endpoints of intervals.

 A: Ultimately this boils down to definition, which Wikipedia states as

A critical point of a function of a single real variable, $f(x)$, is a value $x_0$ in the domain of $f$ where it is not differentiable or its derivative is $0$ ($f'(x_0)=0$).

If we follow this religiously, then, yes, endpoints should be considered critical points because the first derivative at those points evaluate to $0$.
Seeing that this is a Calculus I problem, I would guess that it is an extremum problem applied to some 'real-world' example? If so, then, IIRC, endpoints are usually counted as 'critical points' (though not in the same sense as the definition above; to differentiate I will call them $\textit{extremum points}$) and should be checked manually (even if the derivative exists and is not $0$). An extremum is still an extremum, even if it is on the endpoints. No one is going to complain that a firm's profits aren't actually maximized on New Year's Eve just because it is the end of the year.
Overall, however, I would suggest that you follow the convention that your textbook is using (but be aware that other definitions exist; check with your school on which definition they use to mark homework and exams).
As for why the author later added that 'we do not allow relative extrema to exist at the endpoints of intervals', I believe the emphasis is on the word $\textit{relative}$ because it suggests that the extremum is 'local' in the sense that it only cares about the values of $f$ around it (and not on the entire domain). But values on the endpoints are unable to look around in $\textit{both}$ directions. I wouldn't take this too seriously though, and, ultimately, the statement depends on the context surrounding it.
