I am trying to come up with a family of continuous functions, which will approximate a rounding to nearest integer function.
I came up with the following solution: $f(x)=x-\beta*\frac{\sin(2 \pi x)}{2 \pi}$, where $\beta \in [0, 1]$
I would like to move further, so that with $\beta \rightarrow \infty$ the function would look staircase-like.
Thanks!
Subtracting $x$ from a staircase shape gives a sawtooth wave. Concentrate therefore on first getting a sawtooth wave to your liking, then add $x$ to it.
Try the following (take as many terms as you need): $$x+\frac{1}{\pi}\left(-\sin\left(2\pi x\right)+\frac{\sin\left(4\pi x\right)}{2}-\frac{\sin\left(6\pi x\right)}{3}+\frac{\sin\left(8\pi x\right)}{4}-\frac{\sin\left(10\pi x\right)}{5}+\frac{\sin\left(12\pi x\right)}{6} - \cdots\right)$$