The rounding function may look like this. I think I might be able to simulate this function with $\text{trianglewave}(x)+x$, some thing like that, but I don't know how to do it.
My final goal is to come up with any functions that can approximate this rounding function while it is differentiable (a smooth approximation).



Here's a suggestion. Set $n$ to a large constant value, and let \begin{align} h(t,c) &= \frac{n}{\sqrt\pi} e^{-n^2 (t-c)^2}, \\ g(t) &= \sum_{k=-\infty}^\infty h\left(t,k+\tfrac12\right), \\ f(x) &= \int_0^x g(t)\,dt \\ &= \frac12 \sum_{k=0}^\infty \left(\mathrm{erf}\left(n \left(x-k-\tfrac12 \right)\right) + \mathrm{erf}\left(n \left(x+k+\tfrac12 \right)\right)\right). \end{align} For $n=100$, the function $f$ has a graph like the one this link produces, except that it continues stepping up or down indefinitely in each direction. (In the linked graph, only the first few terms of $f(t)$ are counted.)
This graph has none of the extra little "bumps" that the Fourier series has, and it is differentiable.