If $f\circ g$ is continuous and $g$ is continuous what about $f$?

I don't know if $f$ is continuous. I believe that isn't necessarly continuous but I don't know some example. If it is continuous I don't know how to prove.

-
If "what about f" means what about continuity of f then you have to put more conditions at least one of them must be g is onto but it is not enough.... – users31526 May 17 '12 at 21:44

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)

-
ya that makes sense! – Theorem May 16 '12 at 22:16
@DennisGulko Thanks for non-trivial example and your effort to help me. – Gastón Burrull May 16 '12 at 22:20

If $g$ is a constant function, $f \circ g$ can be continuous while $f$ isn't necessarily so.

-
Thanks. It is easy counterexample. – Gastón Burrull May 16 '12 at 22:15
Sorry, I can't validate two answers. Both are correct in the same time. – Gastón Burrull May 16 '12 at 22:25