# Thread: Counterexample of two functions not continuous but composition is

1. ## Counterexample of two functions not continuous but composition is

Question:
If f: D->E and g: E->F are not continuous on D and E, respectively, then the composition g $\displaystyle \circ$f is NOT continuous on D.

I'm guessing False on this statement but can't come up with the counterexample needed.

Any suggestions?

Thank you.

2. ## Re: Counterexample of two functions not continuous but composition is

For example take $\displaystyle D=E=F =\mathbb R$ and $\displaystyle f(x)=g(x) = \begin{cases}1&\mbox{if }x\in\mathbb{Q}\\ 0&\mbox{if }x\in\mathbb{R}\setminus \mathbb{Q}.\end{cases}$

3. ## Re: Counterexample of two functions not continuous but composition is

Originally Posted by girdav
For example take $\displaystyle D=E=F =\mathbb R$ and $\displaystyle f(x)=g(x) = \begin{cases}1&\mbox{if }x\in\mathbb{Q}\\ 0&\mbox{if }x\in\mathbb{R}\setminus \mathbb{Q}.\end{cases}$
For CountingPenguins:

g(x) in girdav post is Dirichlet Function -- from Wolfram MathWorld