Why does the outer function $f$ of $f(g(x))$ have to be continuous? Consider the limit of a composite/nested function
$$C = \lim _{x \rightarrow c} f(g(x))$$
If $f$ is a continuous function at $f(a)$ where point $a = \lim _{x \rightarrow c} g(x)$ then we could also compute the composite as:
$$C = f(\lim _{x \rightarrow c}g(x))$$
I don't know how to prove this exactly. I understand that the limit of a single function doesn't require the point itself at $c$ to be defined, and the function doesn't have to be continuous in order for the limit to exist, but why does $f$ have to be continuous? What makes this identity work?
 A: Because $f$ is continuous at $a$, for every series $(x_n)_{n\in\mathbb{N}}$ with $\lim_{n\to\infty}x_n = a$ also holds $\lim_{n\to\infty}f(x_n) = f(a)$.
Now we take an arbitrary series $(y_n)_{n\in\mathbb{N}}$ with $\lim_{n\to\infty}y_n = a$.
If we now substitute with $y_n$ we get: 
$$\lim_{n\to\infty}f(g(y_n))$$
By this construction we have now created a series $g(y_n)$ with limit $a$ for $n\to\infty$.
And because $f$ is continuous at the limit of $g(y_n)$, $$\lim_{n\to\infty}f(g(y_n)) =f(\lim_{n\to\infty}g(y_n)) = f(a)  $$

To understand the importance of continuity, take $f(x) = \begin{cases}
0, \quad x<1\\
1, \quad \text{else}
\end{cases}$
In the first place, this function doesn't have a (two-sided) limit in x=1, but two different limits, depending from which side you move towards 1.
Let's now take a simple series $(x_n)_{n\in\mathbb{N}}$  that converges to 1: $ \quad x_n = 1- \frac{1}{2^n}$
If you now calculate the limit of $f(x_n)$ for $n$ tending to infinity, you get  $\lim_{n\to\infty} f(x_n) = 0$ . However, if you substitute $x$ in $f(x)$ directly with 1, you get $f(1)= 1$ .
With a continuous function scenarios like that can not happen, you'll always have the equality $$lim_{n\to\infty} f(x_n) = f(lim_{n\to\infty} x_n)$$
