Can a function have a relative extreme at a removable singularity? I was presented this free response problem set in AP Calculus BC today regarding Taylor series polynomials. The given function $g(x)=\frac{\cos(2x)-1}{x^2}$ contains a removable singularity at $x=0$, so it can be (and is according to the paper) defined for all $x\ne0$. After finding a 4th degree Taylor polynomial for $g(x)$, the following prompt is provided:
Determine whether $g$ has a relative minimum, a relative maximum, or neither at $x=0$. Justify your answer.
I claimed that $g$ cannot have a relative minimum or maximum at $x=0$ because $x=0$ is not in the domain of $g(x)$.
My teacher claimed that this is wrong because the restricted domain of $g(x)$ is irrelevant. He answered the prompt by utilizing the 4th degree Taylor polynomial for $g(x)$:
$$g(x)=-2+\frac{2^4x^2}{4!}-\frac{2^6x^4}{6!}$$
$$g'(x)=\frac{2^5x}{4!}-\frac{2^8x^3}{6!}$$
$$g'(0)=\frac{2^5(0)}{4!}-\frac{2^8(0)^3}{6!}=0$$
$$\text{Therefore, }g(x)\text{ has a relative extreme at }x=0$$
$$g''(x)=\frac{2^5}{4!}-\frac{3*2^8x^2}{6!}$$
$$g''(0)=\frac{2^5}{4!}-\frac{3*2^8(0)^2}{6!}=\frac{2^5}{4!}$$
$$g''(0)>0$$
$$\text{Therefore, }g(x)\text{ has a relative minimum at }x=0$$
I assume it is okay to use that Taylor polynomial to approximate $g(x)$ since the derivative of the Taylor polynomial should be the same sign as $g(x)$ at any degree given that the series is centered at the point being analyzed. I never learned that in class though, and we've basically just started learning about Taylor series, so maybe that observation is false. I imagine that my assumption at least works for the problem above. Ignoring the efficacy of the method, $g'(x)<0$ immediately before $x=0$, and $g'(x)>0$ immediately afterwards, satisfying the conclusion.
Despite all of this, I fail to see how the singularity at $x=0$ is irrelevant. If it means anything, a removable singularity is actually considered a discontinuity in AP Calculus. That said, the AP Calculus courses also claim that a function is non-differentiable where it is discontinuous, so I assume that it is impossible to find $g'(0)$ to determine the point's status as an extreme anyway since there would have to at least be a "discontinuity" there. Furthermore, the free response prompt explicitly states that $g(x)$ is undefined at $x=0$.
While writing this post, I became even more confused when I noticed the first sentence in the free response problem set. It says:
The function $g$ is continuous for all real numbers $x$ and is defined by $g(x)=\frac{\cos(2x)-1}{x^2}\text{ for }x\ne0.$
Now I am wondering how $g$ could possibly be continuous for all real numbers $x$ if there is a value of $x$ at which $g(x)$ is not defined.
Am I just reading way too deep into all of this and/or making errors in logic, or is my calculus teacher wrong? This post contains multiple questions, so I want to make it clear that the title is my main issue.
 A: A function cannot be extremal at a singularity, since by definition they are undefined at singularities, while the definition of an extremum requires us to give a value taken by the function at the extremum. Though also note that singularities are not discontinuities, for the very same reason: wether a function is discontinuous at a point or not depends on the value it takes there, and if it's undefined at a point, the definition of continuity makes no sense for that point.
But: singularities pose the interesting question wether a function $f$ can be continuously extended to the singularity. Can we define a new function $\tilde f$ which agrees with the old function wherever it is defined, and which is also defined at the singularity, and which is continuous there? If the question can be answered with "yes", we call the singularity removable. So for removable singularities it makes sense to ask wether $\tilde f$ is extremal at the singularity of $f$. That's the mathematical content of the question "Is $f$ extremal at its removable singularity?". It really asks about $\tilde f$, not about $f$. But since there is only one such $\tilde f$, we can kind of imagine that $\tilde f$ is what $f$ should have been from the beginning, since it's the only natural way to extend $f$. This often leads to people dropping the distinction entirely, which is what your teacher did.
