A lot of people come here asking, essentially, some variation of the following:
I know how to write a piecewise function that [does something]. How do I write a non-piecewise function that does the same thing?
To my mind, that is like asking the following:
I've written this formula in red whiteboard marker. How do I write it in blue whiteboard marker instead?
Probably there is some use to doing this, given that so many people ask for it, but I haven't the faintest idea what that use is. Most of the time, it makes the function longer and more complex, often with some combination of $(-1)^n$, absolute value notation, and periodic functions such as sine and cosine popping up. I don't see the use of these extra terms in most cases. They obscure the core purpose and behavior of the function.
What is the purpose of rewriting a function to avoid piecewise notation? In what contexts does it help you reason about the function?
Occasionally, it's useful to interpolate a discrete-valued function using some sort of differentiable function, so that say, the function can be optimized using gradient descent. But otherwise, these questions basically come from either people who are just curious, or misguided students who think that piecewise functions somehow "don't count" as mathematical formulae, basically just out of habits ingrained in them at school.