∀ {α : Type u_1} {β : Type u_2} [inst : TopologicalSpace α] [inst_1 : TopologicalSpace β] {f g : α → β} {s : Set α}
  {p : α → Prop} [inst_2 : (a : α) → Decidable (p a)],
  (∀ a ∈ s ∩ frontier {a | p a}, f a = g a) →
    ContinuousOn f (s ∩ closure {a | p a}) →
      ContinuousOn g (s ∩ closure {a | ¬p a}) → ContinuousOn (fun a => if p a then f a else g a) s