That is certainly the most convenient way to do it. The usual conditions ensuring that a function is uniformly continuous are either (a) it is continuous on a bounded closed interval, or (b) it is differentiable with a bounded derivative.

The function on the interval does not satisfy either of those conditions. But it satisfies (a) and (b) on the overlapping subintervals and respectively. From that, you can deduce that it is uniformly continuous on the whole interval.