# composition of continuous functions

I was wondering if a function $f:[a,b]\rightarrow[c,d]$ is continuous, $g:[c,d]\rightarrow\mathbb{R}$ is continuous, does it necessarily imply that $g\circ f$ is continuous? Are there counterexamples? What is the necessary and sufficient condition for $g\circ f$ to be continuous?

This is not HWQ. I am just wondering if that is possible.

-
I don't understand your title – Cortizol Mar 2 '13 at 13:00
Possible duplicate to this – mez Mar 2 '13 at 13:05
Yes. composition of continous functions is necessary continous. – Hanul Jeon Mar 2 '13 at 13:07
sorry, you said RS integrable and confused me. – mez Mar 2 '13 at 13:14
I give two proofs below. One by and $\varepsilon$-$\delta$ argument and one by the characterization of continuity that says inverse-images of open sets are open. – Michael Hardy Mar 2 '13 at 13:22

With the sequence definition of continuity it is obvious that $g\circ f$ is continous, because $$\lim_{n\rightarrow \infty} g(f(x_n))=g(\lim_{n\rightarrow \infty} f(x_n)) = g(f(\lim_{n\rightarrow \infty} x_n))$$ because $f$ and $g$ are continuous.

It is hard to say what is necessary that the composition of function is continuous, taking

$$D(x)=\left\{ \begin{array}{rl} 0 & x\in \mathbb{R}\setminus \mathbb{Q}\\ 1 & x \in \mathbb{Q}\\ \end{array} \right.$$ is discontinuous in every $x\in \mathbb{R}$ but $D(D(x))=1$ is $C^\infty$.
$C^\infty$ means the function is arbitrary often continuous differentiable.

-

One definition of continuity says $f$ is everywhere continuous if and only if for every open set $G$, the set $$\{ x\in\text{domain} : f(x) \in G\}$$ is open. So look at $$\{x : g(f(x))\in G\} = \{ x : f(x) \in \{ w : g(w)\in G\} \} = \{ x : f(x) \in H\},$$ where $H=\{ w : g(w)\in G\}$. The set $H$ is open because $g$ is continuous, and the last set mentioned above is open because $H$ is open. Therefore the first set mentioned on the line above is open; therefore $g\circ f$ is continuous.

There's also the $\varepsilon$-$\delta$ definition of continuity, which readily defines the notion of continuity at a point $x$ in the domain. Given $\varepsilon>0$, we seek $\delta>0$ so small that if the distance from $x$ to $y$ is less than $\delta$, then the distance from $g(f(x))$ to $g(f(y))$ is less than $\varepsilon$. Given $\varepsilon>0$, the continuity of $f$ at $f(x)$ entails that there exists $\eta>0$ such that whenever the distance from $f(x)$ to $w$ is less than $\eta$, then the distance from $g(f(x))$ to $g(w)$ is less than $\varepsilon$. Next, the continuity of $f$ at $x$ entails that there exists $\delta>0$ such that if the distance from $x$ to $y$ is less than $\delta$, then the distance from $f(x)$ to $f(y)$ is less than $\eta$. The desired conclusion follows. So if $f$ is continuous at $x$ and $g$ is continuous at $f(x)$, then $g\circ f$ is continuous at $x$.

-
thank you for detailed answer. – user45099 Mar 2 '13 at 13:26

Yes it is continuous. Compositions of two continuous functions is always continuous. In this case you can see it by the sequential definition of continuity.

$$x_n\rightarrow x \Rightarrow f(x_n)\rightarrow f(x) \Rightarrow g(f(x_n))\rightarrow g(f(x))$$

-

Here's the proof using the $\varepsilon - \delta$ definition :

Fix $\varepsilon > 0$. By the continuity of $g$ in $[c,d]$ which contains some points of $f([a,b])$ there exits $\gamma$ such that $d(g(y),g(f(q))) < \varepsilon$ when $d(y,f(q)) < \gamma$ for some point $q\in[a,b]$ where $y\in f([a,b])$

Now since $f$ is continuous there exists $\delta > 0$ such that $d(f(x),f(q))< \gamma$ when $d(x,q)< \delta$ where $x\in [a,b]$

Let $h= f \circ g$ then from the above it follows that $d(h(x),h(q))=d(g(f(x)),g(f(q))) <\varepsilon$ when $d(x,q)< \delta$ . Hence $h=f \circ g$ is continuous

-