# Prove: $f$ is continuous iff $f_{+}(x)$ and $f_{-}(x)$ are continuous

Let $D \subset \mathbb{R}$ and $f : D \to \mathbb{R}$

We would like to show that $f$ is continuous iff $f_{+}(x)$ and $f_{-}(x)$ are both continuous, given:

$$f_{+}(x) := \begin{cases} f(x) & \text{if f(x) \geq 0} \\ 0 & \text{otherwise} \\ \end{cases}$$

$$f_{-}(x) := \begin{cases} -f(x) & \text{if f(x) \leq 0} \\ 0 & \text{otherwise} \\ \end{cases}$$

Hints?

• If we are given that $f_+$ and $f_-$ are continuous the only "problem" is at x= 0. Jun 21, 2017 at 14:59
• @user247327 Why should $x=0$ be a problem? Jun 21, 2017 at 15:00
• Because I misread the problem! I thought it said "for $x\ge 0$" and "for $x\le 0$" rather than f(x). And it really annoys me that a carriage return posts the comment! I keep pressing carriage return before I intend to post. Jun 21, 2017 at 15:03

Hint: If $f,g$ are continuous, then so are $f+g$ and $\max\{f,g\}$.

• And also $f-g$. Jun 21, 2017 at 15:00

One has

$$f(x)=f_+(x)-f_-(x)$$

Indeed when $x$ is such that $f(x)\geq 0$, $f_+(x)=f(x)$ and $f_-(x)=0$; when $x$ is such that $f(x)\leq 0$, $f_-(x)=-f(x)$ and $f_+(x)=0$.

From this identity we derive immediately that when $f_\pm$ are continuous than $f$, being the sum of two continuous functions is continuous.

For the converse assume now that $f$ is continuous. $f_+(x)=\operatorname{max}(f(x),0)$ and $f_-(x)=\max(-f(x),0)$. And so they are continuous as the maximum of two continuous functions.