Composition of a continuous function and a discontinuous function, can be continous.

Your answer is correct: if $a≠1$, then $\lim\limits_{x \to a} g(f(x))=g(f(a))$ because $g$ is continuous at any point and $f$ is continuous at $a$.

You can create another example by taking $f$ to be any discontinuous function, and $g : x \mapsto c$ any constant function, so that $g \circ f$ is constant and, in particular, is continuous.


In general, if $y_0 = \lim\limits_{x \to x_0} f(x)$ and $l = \lim\limits_{y \to y_0}g(y)$ exist and if there exists some $\epsilon>0$ such that $f(x)≠y_0$ for all $x$ with $0<|x-x_0|<\epsilon$, then $l=\lim\limits_{x \to x_0} (g \circ f)(x)=:L$.

The second hypothesis is important. For instance, if you consider the constant function $f \equiv 1$, $g = \mathbb 1_{\{1\}}$ and $x_0=0$, then $y_0=1,l=0$ but $L=1$.