# Can a point be a global extremum but not a local extremum?

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.

-
You are missing the fact that to be a local extremum the required inequality has to hold in a relative neighborhood of the point in the domain of the function, that is, in the intersection of an open interval with the domain of the function. –  Mariano Suárez-Alvarez Jan 4 '12 at 23:30

The interval $(0.9,1]$ is indeed an open subset of the space $[0,1]$, and the maximum at $1$ is a local maximum.
One sec. Let's say $f(x)=x^2, \forall x \in \mathbb{R}$. Then isn't the interval $(0.9,1]$ still an open subset of $(-\infty,\infty)$ such that 1 is a local maximum? –  Vivek Viswanathan Jan 5 '12 at 3:31
$(0.9,1]$ is not an open subset of $\mathbb{R}$, but it is an open subset of $[0,1]$. –  Michael Hardy Jan 5 '12 at 19:56