Limits and substitution As in @RobertZ's answer to this question, we often perform substitutions when evaluating limits. For instance, if you're asked to show that 
$$
L = \lim_{t \to 0} \frac{\sin t^3}{t^3} = 1,
$$
it's pretty common to say "Let $x = t^3$; then as $t \to 0$, we have $x \to 0$, so 
$$
L = \lim_{x \to 0} \frac{\sin x}{x}
$$
which we know is $1$, and we're done."
What's going on here in general is an application of the following "Theorem"
Theorem 1: If the function $g$ satisfies [fill in missing properties] and $$\lim_{t \to a} g(t) = b,$$ then 
$$
\lim_{t \to a} f(g(t)) = \lim_{x \to b} f(x),
$$
i.e., one limit exists if and only if the other does, and if they both exist, they're equal. 

In the example above, $f(x) = \frac{\sin x}{x}$ and $g(t) = t^3$ and $a = b = 0$.

There's an alternative form, in which we're asked to show that
$$
L = \lim_{t \to 0} \frac{\sin \sqrt[3]{t}}{\sqrt[3]{t}} = 1,
$$
it's pretty common to say "Let $t = x^3$; then as $t \to 0$, we have $x \to 0$, so 
$$
L = \lim_{x \to 0} \frac{\sin x}{x}
$$
which we know is $1$, and we're done."
In this case, the implicit theorem is very similar to the other, but with the role of $g$ reversed (i.e., we're substituting $ t = x^3$ instead of $x = t^3$, so the natural form of the theorem puts $g$ on the other side): 
Theorem 2: If the function $g$ satisfies [fill in missing properties] and $$\lim_{x \to b} g(x) = a,$$ then 
$$
\lim_{t \to a} f(t) = \lim_{x \to b} f(g(x)).
$$

In the second example above, we have $a = b = 0$, $f(t) = \frac{\sin \sqrt[3]{t}}{\sqrt[3]{t}}$, and $g(x) = x^3$.
The two theorems are obviously the same: if you swap $a$ and $b$, $x$ and $t$, and reverse the equality in the last line, they're identical. But each represents a different approach to working with limits, so I've stated both. 
In the second form, it's clearly important that $g$ be surjective near $a$ (i.e., for every small enough interval $I = (b-\epsilon, b + \epsilon)$, there's an interval $I' = (a-\delta, a + \delta)$ such that $I- \{b\} \subset g(I' - \{a\})$. (Hat-tip to MathematicsStudent1122 for the observation that I need to delete $a$ and $b$ from those intervals).  Otherwise you could use things substitutions like $s = t^2$, which would turn a two-sided limit into a one-sided one (or vice versa), in which case one limit might exists and the other might not. 
Addendum to clarify why this might matter, for @MathematicsStudent1122:
Consider $$f(x) = \begin{cases}
1 & x \ge 0 \\
0 & x < 0
\end{cases}.$$
and look at $L = \lim_{x \to 0} f(x^2)$. It's clear that $L$ exists and is $1$. But if we substitute $t = x^2$, then we get $L = \lim_{t \to 0} f(t)$, which does not exist; hence this "substitution" is not valid: I've turned what amounts to a 1-sided limit (which exists) into a two-sided limit (which does not exist). The domains of $f$ and $g$ are both all of $\Bbb R$. 
(End of addendum)
My question is this: 
What is a reasonable set of missing properties for each of these theorems? (I can work out the exact properties easily enough by running through the definitions, but they don't seem to be very helpful/checkable.) 
One answer might be "$g$ is locally a bijection", but that rules out things like $y = x + x\sin \frac{1}{x}$ near $x = 0$, so it seems too limited. (It also rules out things like $x \mapsto x + \sin x$ for limits as $x \to \infty$, which is a pity.) 
I recognize that this is not a strictly mathematical question. But my goal is to come up with a "calculus student's theorem", one that says "if you're trying to work out a limit, which may or may not exist, then it's OK to do substitutions of this sort along the way," and which will cover the vast majority of the problems that they might encounter in a standard calculus book, or even in Spivak's book. 
This question gives two theorems, but both have assumptions about the existence of limits. This one comes a little closer, but still isn't entirely satisfactory. 
I'd love any nice-enough condition to be broadly useful. In particular, I think it's completely reasonable to require, for instance, that the "substitution function" $g$ be continuous, and perhaps even differentiable (although I doubt that's of much use). 
 A: I'm afraid this isn't quite what you're after, but it seems to be a decent starting point. These conditions, while restrictive, appear to be necessary for the following proof.
Assume $\lim_{x\to a}g(x)=b$, where the function $g$ also satisfies:
$$ \text{there exists a neighborhood $U$ of $a$ such that $b\not\in g(U\setminus\{a\})$} \tag{1}$$
and for each $(y_n)$ converging to $b$ with $y_n\ne b$,
$$ \text{there exists $(x_n)$ such that $g(x_n)=y_n$ for large $n$ and $x_n\to a$}. \tag{2}$$
Then we show that $$\lim_{x\to a}f(g(a)) = \lim_{y\to b}f(y).$$
Proof:
Let $L_1:=\lim_{x\to a}f(g(a))$ and $L_2:=\lim_{y\to b}f(y)$, either of which may or may not exist.
We will use the sequential criterion.
First suppose $L_2$ exists and let $(x_n)$ be a sequence such that $x_n\to a$ and $x_n\ne a$ for all $n$. Since $\lim_{x\to a}g(x)=b$, we have $g(x_n)\to b$. Due to $(1)$, we have $g(x_n)\ne b$ for $n$ large enough. Then, because $L_2$ exists, we have $f(g(x_n))\to L_2$. This proves by the sequential criterion that $L_1$ exists and $L_1=L_2$.
Now assume $L_1$ exists and let $(y_n)$ be a sequence such that $y_n\to b$ and $y_n\ne b$ for all $n$.
By $(2)$ there exists a sequence $(x_n)$ such that $g(x_n)=y_n$ for large $n$ and $x_n\to a$. Since $y_n\ne b$ for all $n$, we have $x_n\ne a$ for large $n$. Then
$$
\lim_{n\to\infty}f(y_n)=\lim_{n\to\infty}f(g(x_n))=L_1,
$$
and so the sequential criterion implies $L_2$ exists and $L_2=L_1$.
