Applications of showing a set is both open and closed? A general technique is as follows:
To show that a property holds for a connected space, one can prove that the set of all points that satisfy this property is nonempty and forms a closed and open set. Then by connectedness, the property must hold for all points in the space.
This finds applications even in serious research problems, for example, the Calabi conjecture was resolved by this technique. What is the intuition behind this innocuous technique, and why is it so useful? Are there other classic examples of this technique being applied?
 A: One common application: 
If you have a holomorphic map between two compact connected Riemann surfaces, it is either constant or surjective.
Proof:  First note that a function which is constant in a n.h. of some point is
in fact constant, via the usual analytic continuation argument.  Thus if it is non-constant, then it non-constant in the n.h. of each point. Thus, 
by the open mapping theorem for holomorphic functions of one variable, it has open image.  On the other hand it has closed image (since the image of a compact set is compact, thus closed).  The target is connected by assumption, QED.
A: This technique seems to be very common in PDE. As long as one can derive some a priori estimates, just like the one in Calabi conjecture, then one can show that the set is closed. The same ideas also come up in e.g. Schauder estimate. Another example is that the Teichmuller space is isomorphic to the space of quadratic differential. There is a proof using harmonic map and this method of continuity. You can find the proof in Jost's Compact Riemann surfaces.
