Let s.t and .Suppose that is a partition of a topological space and that is a map to another space . Prove that if the restrictions and are both continuous then is continuous.

I need to show that and are connected (since if is continuous on and , then the only place it might be discontinuous is at the boundary, where meets ).

is connected (as is ) since is a continuous map between any two points.

This is what I know, but I can't see what I can do from here! Can someone help?