Prove that the limit notation can be taken out when the outside function is continuous While studying the solution of the problem
$$
\lim \limits_{x \to \inf} \ (1+ \frac{1}{x})^x,
$$
I was getting confused on the nature of limits. The first step for solving the above question is to set the limit as a function $y$, and take the natural log of the function. In other words,
$$
y=\lim \limits_{x \to \inf} \ (1+ \frac{1}{x})^x
$$
$$
\ln y=\ln [ \ \lim \limits_{x \to \inf} \ (1+ \frac{1}{x})^x \ ]
$$
The next step is to take the limit notation outside the natural log.
$$
\ln y= \lim \limits_{x \to \inf}  [ \ \ln\ (1+ \frac{1}{x})^x \ ]
$$
My textbook explains that I can do this because the natural log is continuous. Here is my question: how do we know that we can do that? In other words, why is that
$$
g( \lim \limits_{x \to c} \ f(x) ) = \lim \limits_{x \to c} \ g(f(x))
$$
if $g(x)$ is continuous at $c \ $? (please don't give explanation to the first problem, whose answer is $e$. I understand why the answer has to be $e$, save for the limit question I provided.)
 A: Let's state the problem more precisely although not in full generality. 
Suppose that


*

*$f$ is defined in a (punctured) neighborhood $U$ of $c$;

*$\lim\limits_{x\to c}f(x)=l$ exists (finite);

*$g$ is defined in a neighborhood $V$ of $l$ and is continuous at $l$.


Then we can conclude that $\lim\limits_{x\to c}g(f(x))=g(l)$.
The proof is an easy verification with the definitions. Suppose $\varepsilon>0$. Then there exists $\eta>0$ such that $(l-\eta,l+\eta)\subset V$ and, for $|y-l|<\eta$, $|g(y)-g(l)|<\varepsilon$.
Since $\lim_{x\to c}f(x)=l$, there exists $\delta>0$ such that $(c-\delta,c+\delta)\subset U\cup\{c\}$ and, for $0<|x-c|<\delta$, $|f(x)-l|<\eta$.
From this it follows that, for $0<|x-c|<\delta$, we have $|g(f(x))-g(l)|<\varepsilon$, thereby proving the statement.
This can be generalized in many ways, particularly to the cases when $l$ is $\infty$ or $-\infty$ and $\lim_{y\to\pm\infty}g(y)$ exists (finite or infinite). Also the hypotheses about the domains of the functions can be relaxed.
In your case there is a slight abuse of notation. A more correct way of dealing with the problem is


*

*We want to compute $\lim_{x\to c}\alpha(x)^{\beta(x)}$

*Instead, we try to compute $\lim_{x\to c}\beta(x)\log \alpha(x)$

*If this limit exists, equal to $l$, then we can apply the theorem above with $f(x)=\beta(x)\log \alpha(x)$ and $g(y)=e^y$, concluding that
$$
\lim_{x\to c}\alpha(x)^{\beta(x)}=e^l
$$
(so you don't “bring the log” outside the limit, but rather “bring in the exponential”).
However, the procedure is often stated as 


*

*set $y=\lim_{x\to c}\alpha(x)^{\beta(x)}$

*then $\log y=\lim_{x\to c}\beta(x)\log\alpha(x)=l$

*therefore $\log y=l$

*hence $y=e^l$
which is incorrect from the logical point of view, because it assumes the existence of $y$. Not a big deal, if you know what you're doing in view of the more precise theorem above.
A: If $\lim_{x\mapsto c} f(x)$ exists and $g$ is continuous in $\lim_{x\mapsto c} f(x)$ then $\lim_{x\mapsto c} g(f(x))$ exists to and
$$
 g(\lim_{x\mapsto c} f(x)) = \lim_{x\mapsto c} g(f(x))
$$
by definition of continuity (I can show you this one with $\epsilon-\delta$ if you whish). 
On the other hand, if $\lim_{x\mapsto c} g(f(x))$ exists and $g$ is continuous, then a lot can happen. As an example if $g$ is constant and $f$ is completely random such that $\lim_{x\mapsto c} f(x)$ doesn't exists, then the latter limit still exists. 
A non trivial example is if $g(y) = sin(y)$ and $f(x)=k_x \pi$ with $k_x\in\mathbb{Z}$ for all $x$ then $g(f(x))\equiv 0$ but depending on the choice of the $k_x$ $\lim_{x\mapsto c}f(x)$ doesn't exist.
Now finally in this example we have more, $f$ is strictly monotonous and continuous. In that case we don't need any further condition on $g$ and get that $\lim_{x\mapsto c} f(x)$ exists exactly then when $\lim_{x\mapsto c} g(f(x))$ exists and if they exist
$$
 g(\lim_{x\mapsto c} f(x)) = \lim_{x\mapsto c} g(f(x)).
$$
Additionally if they exist we get for free that $g$ is continuous in $c$.
