You can get pretty close by starting with arctan(tan(x)). This gives you a sawtooth which you can shift, scale and subtract from f(x)=x. It's just those pesky points where tan x is undefined that get you.
Will you allow arctan2 as part of an algebraic formula?
To get answers that you want, you will note that the posters so far have asked how you define algebraic. These answers are reasonable. Please provide a solid definition. We cannot leave the thread open, if you continue to have the people who are helping you forced to guess. Thanks.
Since the OP has come back to the site and ignored the request for question improvement, this thread is closed. Thanks to the two posters who gave it a good try.