Since the other question doesn't address the infinite case, I will try to prove some of them here myself. They are generally quite simple and there are numerous cases so I won't write them out all here.
Lemma 1. Suppose that $\lim_{y\to \pm\infty} f(y)= \ell$ and suppose that $\lim_{x\to a} g(x)=\pm\infty$. Also suppose that the range of $g$ is a subset of the domain of $f$. Then $$\lim_{x \to \pm\infty} f(g(x)) = \ell $$
Proof. We only do the case for positive infinity. The negative case goes similiarly.
We know that, for every $\varepsilon>0$, there is a $K$ such that for all $y>K$ we have $|f(y)-\ell|<\varepsilon$.
Also, we know that, for any $M$, that there is a $\delta$ such that if $|x-a|<\delta$, then $g(x) > M$.
Now we have that there exist $\delta$ such that if $|x-a|<\delta$, then $g(x)> K$ and thus $|f(g(x))-\ell|<\varepsilon$. This concludes the proof.
Lemma 2. Suppose that $\lim_{y\to \ell} f(y)= \pm\infty$ and suppose that $\lim_{x\to a} g(x)=\ell$, yet $g$ does not attain the value $\ell$ in the neighbourhood of $x$. Also suppose that the range of $g$ is a subset of the domain of $f$. Then $$\lim_{x \to a} f(g(x)) = \pm\infty$$
Proof. We only do the case for positive infinity. The negative case goes similiarly.
We know that, for any $M$, that there is a $\delta_1$ such that if $|x-\ell|<\delta_1$, then $f(x) > M$.
We know that, for every $\varepsilon>0$, there is a $\delta_2$ such that if $|x-a|<\delta_2$ we have $|g(x)-\ell|<\varepsilon$.
Therefore, there is a $\delta$ such that if $|x-a|<\delta$, then $|g(x)-\ell|<\delta_1$, and then we can conclude $f(g(x)) > M$.