Problem: Let $X$ be the uniform random variable on $[-1, 1]$. We know its PDF is just $f_X(x) = \frac{1}{2}$ for $x \in [-1,1]$ and $0$ everywhere else, and its CDF is $F_X(x) = \frac{x+1}{2}$ on $[-1,1]$, $0$ on $(-\infty, -1)$ and $1$ on $(1, \infty)$. Now define another random variable $Y$, where $f_Y(y) = 2 e^{-2y} u(y)$, i.e., it's an exponential RV. Question: find $g: \mathbb{R} \to \mathbb{R}$ such that $Y = g(X)$ (i.e. find $g$ such that $f_{g(X)}(g(x))$ is as stated above).
In the solution to this problem, basically $F_X(x) = F_{G(X)}(g(x))$ is solved for $x \in [-1, 1]$ to obtain $g$, i.e., solve: $$\frac{x+1}{2} = 2e^{-2g(x)}$$
What I am confused about is why we only restrict our attention to $x \in [-1,1]$. Since $F_X$ and $f_X$ technically speaking operate on all of $\mathbb{R}$, shouldn't we also consider other $x$'s? Yes I know $f_X$ only has support on $[-1,1]$ and that the nature of the exponential variable seems to be restricting the $x$ we can focus on. But I would like an explanation that rigorously explains this specific problem, and how to solve a problem like the one I have in general. Any help is appreciated!