How To Find A Piecewise Constant Function