Why does my analysis textbook almost always prove theorems about differentiability on OPEN intervals $(a,b)$ and not CLOSED intervals $[a,b]$? This is annoying because I want to use theorems about differentiability on closed intervals. For example, my textbook has the theorem "$f$ is monotone increasing on $(a,b)$ iff $f'(x) \geq 0$ for every $x$ in the interval." If this theorem worked with closed intervals, then my solution below would be fixed. Here is the problem that's making me say all this
Suppose we got $f'(x) = nk(x-x_0)^{n-1}$, where $n-1$ is odd. I want to prove that $x_0$ is a local minimum. So we get that $f'(x_0) = 0$, $f'(x) > 0$ for $x > x_0$ and $f'(x) < 0$ for $x < x_0$. Thus, when you consider a neighborhood around $x_0$, we see that $f'(x) \geq 0$ for $x \geq x_0$ and $f'(x) \leq 0$ for $x \leq x_0$. Then, if only I had access to the theorem I want above, I can conclude that $x_0$ is a local minimum as from the left we have monotonically decreasing and from the right we have monotonically increasing.
 A: The problem is that $f$ cannot be differentiable at the endpoints of an interval $[a,b]$ since $\lim_{x\to a}\frac{f(x)-f(a)}{x-a}$ and $\lim_{x\to b}\frac{f(x)-f(b)}{x-b}$ do not exist, only one-sided limits exist.
We could define differentiability from the right at $a$ and from the left at $b$ (as we do for continuity) but in practice (aka a typical Calculus course), it is not that useful.
On the contrary, continuity from the left and continuity from the right are useful and natural. That's why we define the continuity of $f$ on $[a,b]$ by

*

*$f$ is continuous at any point of $(a,b)$

*$f$ is continuous from the left at $b$

*$f$ is continuous from the right at $a$
This is useful since it allows us to state important theorems, such as Mean Value Theorem or Intermediate Value Theorem, in a concise way. For example, continuity from the left at $a$ and from the right at $b$ is crucial for the Mean Value Theorem and the theorem fails if $f$ is only continuous and differentiable on $(a,b)$.

In your case, if $f(x)=(x-x_0)^n$ ($n$ even), you have $f'(x)<0$ for $x<x_0$ and $f'(x)>0$ for $x>x_0$, so $f$ is decreasing on $(-\infty,x_0)$ and increasing on $(x_0,\infty)$.
Since $f$ is continuous on $\mathbb R$, this implies that $f$ is actually decreasing on $(-\infty,x_0]$ and increasing on $[x_0,\infty)$ $(*)$. Therefore, $f$ has a local (and global) minimum at $x_0$. I reckon that many textbooks seem to not make mention of $(*)$.
A: If $f$ is nondecreasing on $(a, b)$ and continuous at $a$, then $f$ is nondecreasing  on $[a, b)$.
This holds since, for any $c \in (a, b)$, we have that
$$
f(a)
= \lim_{x\downarrow a}f(x)
\leq f(c)
$$
since eventually any $x$ converging to $a$ will be less than $c$ and so $f(x) \leq f(c)$.

This seems to be enough for what you need, but is also shows that if $f$ is differentiable on $[a, b)$ with $f' \geq 0$ (where $f'(a)$ is interpreted as the right derivative of $f$ at $a$), then $f$ is also right-continuous at $a$ and so continuous on $[a, b)$, from which we can conclude that $f$ is nondecreasing on $[a, b)$.
The reason that the theorem you're quoting is phrased like that is because $f$ can be nondecreasing on $(a, b)$ but not be differentiable at $a$ (for example $f(x) = \sqrt{x}$ on $[0, 1)$).
