When can I move the limit operand into a function?
By definition of the continuous function:
Function is continuous at $x_0$ iff $\lim_{x\to x_0} f(x)$ exists and
$$\lim_{x\to x_0} f(x) = f(x_0)$$
Thus, if function $f$ is continuous at $g$ and $\lim\limits_{x\to x_0} g(x)=g$ then:
$$\lim_{x\to x_0}f(g(x))=f\left(\lim_{x\to x_0} g(x)\right)$$
When you are operating on $\pm\infty$ you can flip the function inside out by substitution $x=\tfrac1u$ so that you are analyzing continuity at $u=0$.
The function has to be continuous. Since continuity at infinity is a controversial concept, change it to a more comfortable situation by setting $x=1/y$.