Q:

Can any piecewise function be represented as a traditional equation?

In "Fundamentals of Electrical Engineering" we learned about piecewise functions for the "unit-step" and "ramp" which are represented by 
$f(x)= \begin{cases}0, & \text{if }x< 0 \\ 1, & \text{if }x>0\end{cases}$ and
$f(x)= \begin{cases}0, & \text{if }x< 0 \\ x, & \text{if }x\ge 0\end{cases}$ respectively. I was bored in calculous class and determined these functions could be represented in traditional algebra by $f(x)= \frac{|x|}{x} \cdot \frac12 + \frac12$ and $f(x)= \frac{x + |x|}2$ So this got me thinking. Can any piecewise function be represented as a traditional equation? Just as an example, how about this one:
$$f(x)= \begin{cases}
   5, & \text{if }x=0 \\
   x^2, & \text{if }x<0 \\
   \sqrt{x} & \text{if }x>0
\end{cases}$$
edit: For the sake of the question, substitute $\sqrt{x^2}$ for $|x|$

A:

The crucial step is to come up with an acceptable way to describe indicator functions, i.e. for certain subsets $S\subseteq \mathbb R$ to replace the piecewise definition
$$1_S(x)=\begin{cases}1&\text{if }x\in S\\0&\text{if }x\notin S\end{cases} $$
with something not involving piecewise, but only "traditional" definitions. Provided that taking limits is allowed as "traditional", we should accept the functions 
$$\begin{align}\max\{x,y\} &=\frac{x+2}{2}+\left|\frac{x-y}{2}\right|\\
\min\{x,y\} &=x+y-\max\{x,y\}\\
1_{[0,\infty)}(x)&=\lim_{n\to\infty}\min\{e^{nx},1\} \\
1_{(-\infty,0]}(x)&=1_{[0,\infty)}(-x)\\
 1_{[a,b)}(x) &=1_{[0,\infty)}(x-a)-1_{[0,\infty)}(x-b)\\
 1_{[a,b]}(x) &=1_{[0,\infty)}(x-a)\cdot1_{[0,\infty)}(b-x)\\
 1_{\{a\}}(x) &=1_{[0,\infty)}(x-a)\cdot 1_{[0,\infty)}(a-x)\end{align}$$
and similar combinations for arbitrary intervals $\subseteq \mathbb R$. With these you get for example 
$$\begin{align}f(x)&= \begin{cases}
   5, & \text{if }x=0 \\
   x^2, & \text{if }x<0 \\
   \sqrt{x} & \text{if }x>0
\end{cases}\\& = 1_{\{0\}}(x)\cdot 5+1_{(-\infty,0)}(x)\cdot x^2+1_{(0,\infty)}(x)\cdot\sqrt x.\end{align} $$
Or, just to make sure, you may want to replace $\sqrt {x}$ with $\sqrt{1_{[0,\infty)}(x)\cdot x}$ (otherwise you'd need a convention that $0$ times undefined is $0$).

