Let and be given. Find according to the definition of continuity at for the functions and . Show that works for .
Crap, I keep forgetting that this form lumps analysis in with topology. Is D a metric space or just a topological space? Which definition of continuity are we working with here? (Of course they're equivalent in any context where they're both valid, but it'll be easier if we're on the same page.)
Analysis, okay. So let's say D is a metric space, and d is the metric. Find such that , and . This is just using the fact that both f and g are continuous at x. Now let . So both of the above relations hold if we replace and with , right? Now by definition, for every x in D, we have h(x)=f(x) or h(x)=g(x). Can you finish from here?