Why is $\lim_{x \to c}g(f(x)) = g(\lim_{x \to c}f(x))$ In this theorem (from the continuity section of the first chapter of a calculus textbook)

If $g$ is continuous at $b$, and $\lim_{x \to c}f(x)=b$, then $\lim_{x\to c}g(f(x)) = g(\lim_{x \to c}f(x))=g(b)$.

I would like an explanation (and proof) of $\lim_{x \to c}g(f(x)) = g(\lim_{x \to c}f(x))$.

Let $y = f(x)$. The key point is that, as $x \to c$, $y = f(x) \to b$, so we can replace $\lim_{x \to c} g(f(x))$ with $\lim_{y \to b} g(y)$, which is $g(b)$ by continuity of $g$ at $b$.
