The other two answers point out that since $[a,a]$ is a closed interval, this definition makes every point into a local max or min.
This might feel like a technicality. You might be more interested in a definition like this one:
$f(a)$ is called a local maximum if $f(a) \geq f(x)$ for all $x$
in some closed interval $[c,d]$ with $a \in [c,d]$ and $c < d$.
This also doesn't work. Consider $f(x) = x$. Then for every number $a$, $f(a)$ is a local max. Use the interval $[a-1,a]$ to see this.
Now you might object that you don't want to allow $a$ to be one of the endpoints. So your modified definition would be
$f(a)$ is called a local maximum if $f(a) \geq f(x)$ for all $x$
in some closed interval $[c,d]$ with $a \in [c,d]$ and $c < d$ and $a\neq c$ and $a \neq d$.
However this last definition is equivalent to the standard definition. If $a$ cannot be an endpoint, you might as well rule them out by considering an open interval instead.