Let $f$ and $g$ be functions from $\mathbb{R}$ to $\mathbb{R}$. That is,
$$f:\mathbb{R}\to\mathbb{R}$$
$$g:\mathbb{R}\to\mathbb{R}$$
If $g$ is continuous at $c\in\mathbb{R}$ and $f\circ g$ is continuous at $c$, then $f$ is continuous at $g(c)$. Not true. Let's see why. We first go through the logic, then we provide an example.
Assume the following:
(i) $g$ is continuous at $c$
(ii) $f\circ g$ is continuous at $c$
By (i), for each $\epsilon>0$, there exists $\delta>0$ such that for each $x\in\mathbb{R}$, if $|x-c|<\delta$, then $|g(x)-g(c)|<\epsilon$.
By (ii), for each $\lambda>0$, there exists $\eta>0$ such that for each $x\in\mathbb{R}$, if $|x-c|<\eta$, then $|(f\circ g)(x)-(f\circ g)(c)|<\lambda$.
We want to show that for each $\xi>0$, there exists $\sigma>0$ such that for each $x\in\mathbb{R}$, if $|x-g(c)|<\sigma$, then $|f(x)-f(g(c))|<\xi$.
Let $\xi>0$ be arbitrary. Now we want to show that there exists $\sigma>0$ such that for each $x\in\mathbb{R}$, if $|x-g(c)|<\sigma$, then $|f(x)-f(g(c))|<\xi$.
We know the following:
(I) there exists $\delta>0$ such that for each $x\in\mathbb{R}$, if $|x-c|<\delta$, then $|g(x)-g(c)|<\xi$.
(II) there exists $\eta>0$ such that for each $x\in\mathbb{R}$, if $|x-c|<\eta$, then $|(f\circ g)(x)-(f\circ g)(c)|<\xi$.
In other words:
(I) If $x$ is close enough to $c$ (how close? $\delta$ close), then $g(x)$ is as close as we want to $g(c)$.
(II) If $x$ is close enough to $c$ (how close? $\eta$ close), then $(f\circ g)(x)$ is as close as we want to $(f\circ g)(c)$.
We have a problem! We cannot say anything about how $f$ behaves when $x$ is really close to $g(c)$!
An Example
Let $f:\mathbb{R}\to\mathbb{R}$ be defined by
$$
f(x)=\begin{cases}
1&\text{if }x\text{ is rational}\\
0&\text{if }x\text{ is irrational}
\end{cases}
$$
This function is called Dirichlet's function.
Let $g:\mathbb{R}\to\mathbb{R}$ be defined by
$$
g(x)=\begin{cases}
\frac{1}{q}&\text{if }x\text{ is rational, in which case }x=\frac{p}{q}\text{ in lowest terms and }q>0\\
0&\text{if }x\text{ is irrational}
\end{cases}
$$
This function is called Thomae's function. It is continuous at every irrational number!
Notice for each $x\in\mathbb{R}$, $(f\circ g)(x)=1$. It is a constant function! Therefore it is continuous.
Let $c\in\mathbb{R}$ be any (I mean any) irrational number. Is $f$ continuous at $c$? No. As a matter of fact, $f$ is discontinuous everywhere! But $g$ and $(f\circ g)$ are continuous at $c$. Therefore the above statement has been proven to be not true.
I hope my long-winded answer not only answered your question, but also informed you of the logic behind continuity, and what it truly means.