Remember that $\lim_{x\to c}f(x)=L$ iff for every sequence $\{x_n\}_{n\in\omega}$ such that $\lim_{n\to \infty}x_n =c$ and $x_n\neq c$ for all $n$ sufficiently large (i.e. there is some $N\in \omega$ such that for all $n\geq N$, $x_n\neq c$) we have $\lim_{n\to \infty}f(x_n)=L$. That is the sequential definition of limit, note how the sequence has to be different from the point it is approximating for large values of $n$, i.e. it has to approximate it without reaching the point -which is the natural idea of a sequence approximating a point-.
Therefore, we have to show that given any sequence $\{x_n\}_{n\in\omega}$ such that $\lim_{n\to \infty}x_n =c$ and there is some $N\in \omega$, then
$$\lim_{n\to\infty}g(f(x_n))=L$$.
So, let $\{x_n\}_{n\in\omega}$ be any sequence approximating $c$ in the above manner. We have that $\{f(x_n)\}_{n\in\omega}$ is a sequence approximating $l$, i.e. with
$$\lim_{n\to\infty}f(x_n)=l$$
by the definition of limit. Here is where the third hypothesis is essential. Let $U$ be a neighborhood of $c$ such that when punctured $f$ does not take the value $l$, i.e. for all $x\in U-\{c\}$, $f(x)\neq l$. Since $\{x_n\}$ converges $c$, there is some $M\in \omega$ such that for all $n\geq M$, $x_n\in U$.
Let $A=\max\{N,M\}$, then for all $n\geq A$, $x_n\in U$ because $n\geq M$ and $x_n\neq c$ because $n\geq N$, i.e. $x_n\in U-\{c\}$. Thus, for all $n\geq A$, $f(x_n)\neq l$, and therefore by the definition of limit,
$$\lim_{n\to \infty}g(f(x_n))=L$$
since $\{f(x_n)\}_{n\in \omega}$ verifies that $\lim_{n\to\infty}f(x_n)=l$ and that for all $n\geq A$, $f(x_n)\neq l$. This completes the proof.
((By petition.) In order to make it clear, since we know
$$\lim_{x\to l}g(x)=L\text{,}$$
we can guarantee (thanks to the sequential definition of limit) that for every sequence $\{y_n\}_{n\in\omega}$ such that $\lim_{n\to\infty}y_n=l$ and such that there is some $C\in\omega$ with the property that for all $n\geq C$, $y_n\neq l$, we have that
$$\lim_{n\to \infty}g(y_n)=L$$
Now, let $\{y_n\}_{n\in\omega}$ be given by $y_n=f(x_n)$, then we have shown it has the desired properties and thus $\lim_{n\to \infty}g(y_n)=L$, i.e.
$$\lim_{n\to \infty}g(f(x_n))=L$$
when substituting $y_n$ by its value $f(x_n)$.)
See how the essential thing was that since $f$ takes not the value $l$ in a punctured neighborhood of $c$ we can guarantee that the sequence $\{f(x_n)\}$ has the desired property, i.e. that is different from $l$ for sufficiently large $n$.