# Can a bounded function be written as the sum of a nondecreasing and non increasing function?

Consider a bounded function $f:[0,1]\to\Bbb R$.

1. Can $f$ be written as the sum of a non-decreasing and non-increasing function?

2. What if $f \in C^1[0, 1]$? Can it be written as the sum of a non-decreasing and non-increasing function?

Every monotone function is continuous except at most countably many points. Thus a function that is discontinuous everywhere on $[0, 1]$ cannot be written as the sum of a non-decreasing function and a non-increasing function.
However, functions in $C^1[0,1]$ do have the desired decomposition. To see this, suppose $f \in C^1[0,1]$. Define functions $g$ and $h$ on $[0, 1]$ as follows: $$g(x) = \begin{cases} f'(x) &\text{ if } f'(x) \ge 0 \\ 0&\text{ if } f'(x) < 0 \end{cases} \quad \text{and} \quad h(x) = \begin{cases} 0 &\text{ if } f'(x) \ge 0 \\ f'(x)&\text{ if } f'(x) < 0. \end{cases}$$ Then $f'(x) = g(x) + h(x)$ for every $x \in [0, 1]$. Hence $$f(x) = f(0) + \int_0^x g + \int_0^x h$$ for every $x \in [0, 1]$. Note that $f(0) + \int_0^x g$ is a non-decreasing function of $x$ and $\int_0^x h$ is a non-increasing function of $x$. Thus we have the desired decomposition.
• Perhaps, mention that the functions $g$ and $h$ defined here are also continuous (since $f'$ is). – B. S. Thomson Dec 1 '15 at 1:54