Let D and E be measurable sets and f a function with domain D U E. Show that f is measurable if and only if its restriction to D and E are measurable.