From a textbook I got the following definition for a local maximum:
$x_0$ is a local maximum of the function $f$ if there exists an open interval $(a, b)$ such that $x_0 \in (a, b)$ and $f (x_0 ) \ge f (x)$ for all $x \in (a, b)$.
I am wondering why this needs to be an open interval? Wouldn't this definition work with a closed interval as well? What would be the problem with a closed interval?