If $f\circ g$ is continuous and $g$ is continuous what about $f$?
For example take any $f$ and $g=0$.
For a less trivial example: take $f(x)=\left\{ \begin{array}{cc} 1 & x\in\mathbb{Q}\\ -1 & x\notin\mathbb{Q} \end{array}\right.$.
Take $g(x)=[x]$. Then $f(x),g(x)$ are both not continuous, while $f(g(x))=1$ is. (Of course you can take a constant function $g$ - in that case $g$ will be continuous)
If $g$ is a constant function, $f \circ g$ can be continuous while $f$ isn't necessarily so.