How to construct a continuous and not monotonic that is close as required to a given function?

42 Views Asked by At

Let $f:[0,1] \to \mathbb R$ be a continuous and monotonic function. Given $r>0$, I would like to construct a continuous function $g:[0,1] \to \mathbb R$ such that

  1. $g$ is NOT monotonic.

  2. $\max_{x\in [0,1]} |f(x)-g(x)| < r$.

The intuition is clear as I draw in the picture. But I fail to construct such required function.

enter image description here

Could you please shed me some light? Thank you so much!

1

There are 1 best solutions below

1
On BEST ANSWER

For sufficiently high $K$, $$g(x) = f(x) + \frac r2 \sin Kx$$ should do the trick.