Testing the continuity of a piecewise function