# decomposition of a function to piecewise functions

Is the next answer correct: $$a\left(z\right)=\sum _{\left\{k\right\}U\left\{k'\right\}:f_k\le \:z,\:z\:\in R,\:f_{k'}\ge z\:;\:z\ge 0}1-\frac{f_k}{z},\:b\left(z\right)=\sum _{\left\{k\right\}:f_k>z,z<0}f_k-z\:$$

Which mean I want to iterate over all the $$f_k$$'s in the $$a(x)$$ equation by the k's which their $$f_k$$s are smaller then $$z$$ for all real $$z$$, and then for positive $$z$$ only on the $$k'$$ which $$f_k'$$ is bigger then z, and the $$b(x)$$ all other, so their sum is exactly the original $$g_i(z)$$ Is this mathematically correct ?

P.S: My try isn't correct, so I will be glad to the right way to do this.