.
In calculus, the Extreme Value Theorem states that if a real-valued function f is continuous on
the closed interval [a,b], then f must attain a maximum and a minimum, each at least once.
See this Wikipedia article
https://en.wikipedia.org/wiki/Extreme_value_theorem
So, the function is assumed to be CONTINUOUS.
But the given function is not continuous : it has singular points at x = -1 and x= 1 inside the interval [-2,2].
So, it does not satisfy the condition of the theorem.
-----------
Explained and completed.