# Thread: Continuous functions

1. ## Continuous functions

Suppose $f,g: D\to \mathbb{R}$ are both continuous on D. Define $h: D\to\mathbb{R}$ by $h(x)=\text{max}\{f,g\}$. Show that h is continuous on D.

Case 1: $f(x)\geq g(x)$

Case 2: $f(x)=g(x)$

Are these the two cases, and if so, I am not sure how to prove this.

2. ## Re: Continuous functions

If the case 1 is " $\forall x\in D,\, f(x)\geq g(x)$" and the case two is " $\forall x\in D,\, f(x)\leq g(x)$", we didn't cover all the cases. For example, with $D=\mathbb R$, $f(x) =x$ and $g(x)=-x$.

You can use the formula $\max\left\{a,b\right\}=\frac{a+b+|a-b|}2$ for $a,b\in\mathbb R$.

3. ## Re: Continuous functions

Originally Posted by girdav
If the case 1 is " $\forall x\in D,\, f(x)\geq g(x)$" and the case two is " $\forall x\in D,\, f(x)\leq g(x)$", we didn't cover all the cases. For example, with $D=\mathbb R$, $f(x) =x$ and $g(x)=-x$.

You can use the formula $\max\left\{a,b\right\}=\frac{a+b+|a-b|}2$ for $a,b\in\mathbb R$.
Why would your case 2 be needed? After showing case 1, could we just say for $f(x)\leq g(x)$ it follows similarly to case 1?

Also, I don't see how $\max\left\{a,b\right\}=\frac{a+b+|a-b|}2$ is going to help.

4. ## Re: Continuous functions

Originally Posted by dwsmith
Why would your case 2 be needed? After showing case 1, could we just say for $f(x)\leq g(x)$ it follows similarly to case 1?

Also, I don't see how $\max\left\{a,b\right\}=\frac{a+b+|a-b|}2$ is going to help.
Yes, but we still don't cover all the cases (the example I gave shows that we can have neither the first case (and the similar) nor the second.

You can write $h =\frac{f+g+|f-g|}2$ and you have to use the fact that the sum of two continuous functions is continuous, and if $u$ is continuous then so is $|u|$.