Is the endpoint of a domain automatically an extreme point? Consider the function $$f(x)=\begin{cases} \sin(1/x) &\mbox{if } x>0 \\ 0 &\mbox{if } x=0.\end{cases}$$
Does this function have a minimum at $f(0)$ ?  I did Google the question, and apparently there is no local minimum at that point. Why ? Assuming I define the domain to be $[0,2π]$, the point $x=0$ is an endpoint which should make it a minimum. Am I correct in my reasoning? 
Thomas' calculus suggests that a function can have an extreme value at the following points:


*

*Interior points where $f'(c) =0.$

*Interior points where $f'(c)$ is undefined.

*Endpoints of the domain of $f$.

 A: For a minimum for $f : D \to \mathbb{R}$ at $x_0$ on $D$ we need


*

*For all $ x \in D: f(x_0) \le f(x)$


In your case $x_0 = 0$ and $f(0) = 0$. Alas for $x_0 = 2/(3\pi) \in [0,2\pi]$ we have $f(2/(3\pi)) = \sin(3 \pi / 2) = -1 < 0$, so $f(x_0)$ is no minimum.

The graph above suggests that on every interval $I = [0, \epsilon)$, with $\epsilon > 0$, there is a $k \in \mathbb{N}$ such that $x_k = 1/(3\pi/2 + 2\pi k) \in I$ $(*)$ and at $x_k$ there is local minimum of $\sin(1/x)$ with $f(x_k) = -1$, which is less than $f(0) = 0$. So there is no local minimum of $f$ at $0$.
About $(*)$:
\begin{align}
x_k &< \epsilon \iff \\
3\pi/2 + 2\pi k &> 1 / \epsilon \iff \\
k &> (1/\epsilon - 3\pi/2) / (2\pi)
\end{align}
For any real $y \in \mathbb{R}$ there is a number $n \in \mathbb{N}$ with $n > y$, which is a consequence of the axiom of Archimedes.
A: The full statement should be that for a piecewise differentiable function, if the absolute extrema exists, then it is the point where one of the 3 conditions hold. It is NOT true that if any of the condition holds, then the point is automatically an extrema.
A: The function could have an extreme value in all the cases you listed, but it is not certain. 
If some point $x_0$ in the domain falls in any of those cases, you should test it to see if it is a minimum, a maximum, or neither of those. 
This test should make sure that there are no points arbitrarily close to $x_0$ where $f$ has values that exceed (in case of a maximum test) or are inferior to (in case of a minimum test)  the value $f(x_0)$.
In your case, it is neither, because the points $$\frac 1 {\frac\pi2 + \pi}, \frac 1 {\frac\pi2 + 2\pi}, \frac 1 {\frac\pi2 + 3\pi}, \dots$$ get arbitrarily close to $0$ and at those $f$ takes the values $$-1, 1, -1, \dots,$$ which are inferior to and exceed $f(0) = 0$ alternately.
A useful test for local minimum/maximum in the interior of a domain is the second derivative test. See also the first derivative test in that same article. Similarly, if $f$ is continuous and differentiable and $f'$ is positive up to a left endpoint, then that endpoint is a minimum. However, none of these apply to your case.
If no test is applicable, you should use your own skills manipulating inequalities to try to show that some point is a local minimum or maximum, or maybe come up with a counterexample like the one I gave above.
