Say I have the following function which is defined for $0 \leq x \leq 1$:
If you would derive this function and substitute $y = 0$, you would get $x = 0.5$ and $x = 0.75$ for the respective as the maximum and minimum point respectively.
Now, what if I ask for which range of $x$ does this function rise? Well, I know that it's:
$$0 < x < 0.5$$ $$0.75 < x < 1$$
What confuses me is: why don't we include the endpoints and make the inequality inclusive? The explanation I have been given is that a slope is determined between two points, but then why is it when you substitute the $x$ coordinate of the endpoints in the derivative, you get a value?

For example, the derivative at the left endpoint is indeed the slope to the right, but there are multiple tangent lines. Therefore the derivative loses its interpretation as the slope of the tangent.
Some reasons other than this are that in some theorems knowing the derivative at the boundary is not necessary in the statement of the theorem, only on the interior. It's not that the derivative on the boundary is meaningless, it's just not needed in, for example, the mean value theorem. In general the derivative is the one sided limit on the boundary, and is perfectly well defined.
In more advanced calculus/differential geometry/differential equations, the derivative at the boundary is used just as much as in the interior. In differential equations we may constrain the derivative at the boundary in our solution, for example.