I vaguely remember hearing that all global extrema are local extrema long ago. However, now that I look carefully at the definition, it appears that if the domain of a function is closed, then a value can be a global minimum without being a local minimum.
For example, imagine a $f(x)=x^2, 0\leq x \leq 1$. Then, 0 and 1 are a global minimum and maximum, respectively, but since $f(x)$ is not equal to $0$ or $1$ on for $x \in I$ where $I$ is an open interval and contained within the domain of the function, $0$ and $1$ cannot be local extrema.
Is my logic correct or am I missing something? If I'm wrong, what am I missing?
(Sorry for the somewhat "yes" or "no" nature of the question. I just can't find the answer elsewhere.)
Thanks.