Composition of functions is continuous? 
If $f$ any $g$ be two functions defined from $[0,1]$ to $[0,1]$ with $f$ strictly increasing. Then

*

*if $g$ is continuous, is $f\circ g$ continuous?


*if $f$ is continuous, is $f\circ g$ continuous?


*if $f$ and $f\circ g$ are continuous, is $g$ continuous?

Here, $f\circ g$ implies composition of $f$ and $g$. I think the answer to the third is yes by using the fact that preimage of an open set under a continuous map is open? Any idea .Thanks.
 A: $(3)$:Since $f$ is increasing it is injective and hence has a left inverse .
Moreover $f$ is given to be continuous so the left inverse is also so and hence $f^{-1}\circ (f\circ g)=g$ is continuous which proves $3$.
$(1)$: $f(x)=$\begin{cases} x & x\in [0,\frac{1}{2}]\\\frac{x}{2}&x\in (\frac{1}{2},1]\end{cases}
and $g(x)=x$,then $f\circ g$ is discontinuous at $\frac{1}{2}$.
$(2)$: $f(x)=x^2$; 
$g(x)=$\begin{cases} 1 & x\in \Bbb Q\cap[0,1]\\0 &x\in \Bbb Q^c\cap [0,1]\end{cases};then $f\circ g$ is discontinuous
A: In plain English:


*

*if $g$ is continuous, is $f\circ g$ continuous?


Not necessarily.  We know that $f$ is strictly increasing, but that does not imply that it is continuous.
Counter-example: Define $f$ as any strictly increasing, non-continuous function.
In other words, stating that the input to $f$ "changes smoothly" (i.e. $g$ is continuous) states nothing whatever about the output of $f$.



*if $f$ is continuous, is $f\circ g$ continuous?


Not necessarily.  $g$ could be any arbitrary function; it may not be continuous.
Describing a function as "continuous" states that if the input changes smoothly, the output changes smoothly.  If the input (in other words, the output of $g$) jumps around arbitrarily (discontinuous), the output of $f$ may not change smoothly.



*if $f$ and $f\circ g$ are continuous, is $g$ continuous?


Yes, but note that the information provided at the beginning of the question, that $f$ is strictly increasing, is necessary to prove this point.
If this restriction is omitted, the following would be a counter-example:
$g(x) = \begin{cases} x \le 0.5 && 0.2 \\ x \gt 0.5 && 0.8 \end{cases}$
$f(x) = 4x^2 - 4x +1$
Note the following attributes of the above function definitions:

*

*$f$ is continuous.


*$f \circ g$ is continous.


*$g$ is not continuous.
A: So the third case is shown to be true properly by learnmore. For the counterexample to case 2), maybe we can take $f=x$ for case 2) and $g=\begin{cases} \frac{x}{2} && x\in[0,0.5)\\ \frac{x+1}{2} && x\in[0.5,1]\end{cases}$. Similar type could be given for case 1)
A: I think, for this kind of question, it's best to go with your gut and see if you can't produce a few examples that corroborate or refute it before trying to prove it. Can you think of any examples or counterexamples to either (1) or (2)? Your proposed answer to (3) is indeed correct, so let's focus on (1) and (2).
For (2), the only things we're given are that $f$ is continuous and strictly increasing. But $g: [0,1] \to [0,1]$ could be pretty much anything! So, your first hunch should probably be "no, $f \circ g$ need not be continuous." Can you find a counterexample?
For (1), try to use the same type of reasoning.
