TITLE: Let $f$ be strictly increasing and $g,\ g\circ f$ is continuous. Does this implies that $f$ is continuous?
QUESTION [5 upvotes]: Let $f,\ g: \mathbb R \to \mathbb R $ be two nonconstant functions. Let $f$ be strictly increasing and $g,\ g\circ f$ is continuous. Does this implies that $f$ is continuous? How to think this question graphically?

REPLY [8 votes]: If $g$ is constant, then $f$ can be anything.
Let $f$ be $$f(x) = \begin{cases} x & x < 0 \\ x+1 & x \ge 0 \end{cases}$$
$f$ is strictly increasing and not continuous at $x=0$.
If $g$ is any continuous function such that $g(0)=g(1)$, then $g \circ f$ is continuous.