Below is the definition of a relative maximum that I am using:
Definition: Let $f:X\rightarrow Y$ be a function. We say $c\in X$ is a relative maximum of $f(x)$ if $\exists(a, b)\subseteq X$: $a<c<b$ and $\forall x\in (a, b)$ $f(x)\leq f(c)$.
Looking at the answer found in $2.$ a neighborhood containing $-3$ can be any set $N$ satisfying: $[-3, \delta-3)\subseteq N \subseteq X$ for some $\delta>0$. Therefore, having $N=[-3, \delta-3)$ where $\delta=1$ would clearly result in $f(-3)$ being called a "relative maximum."
This is a problem because my definition does not state $-3$ would be a relative maximum as there is no open interval containing $-3$ here. The domain of $f$ cannot stretch out that far.
Question: If one were teaching Calculus, what definition is better to use? Is $f(x)$ a relative maximum at $x=-3$ here or not...

Instead of requiring $(a,b)\subset X$ as in your definition, the usual definition would instead require that $f(x)\leq f(c)$ for all $x \in X \cap (a,b)$ (where $a < c < b$).
With this (usual) definition, your solution is correct.
With the (unusual) definition that you cite, the point -3 would not be a local (or relative) maximum.