Answer
f has local maxima at x=$-2$ and at x=$2$.
The local maxima are $6$ and $10.$
Work Step by Step
A function $f$ has a local maximum at $c$ if there is an open interval in $I$ containing $c$
so that, for all $x$ in this open interval, we have $f(x)\leq f(c).$
---
If we define the interval $I_{c}$ that contains c as $(c-0.5,c+0.5)$,
we see that on such an interval around $x=-2,$
$f(-2)$ is 6, and is the greatest function value on $I_{(-2)}$.
Also, for such an interval around $x=2,$
we see that $f(2)=10$ is the greatest function value on $I_{2}$
Thus, f has local maxima at x=$-2$ and at x=$2$.
The local maxima are $6$ and $10.$
The edges of the interval are not local maxima, because there is no open interval surrounding the edge such that f is defined on the whole interval,
which is required by the definition.