Sometimes used in classical names like Danaë and Zoë to indicate that the e is a separate syllable, because normally ae and oe are diphthongs in Latin (and in Greek rendered via Latin).

It was formerly used in English with the same function, as in aërial, which is from Greek aêr, the a and the e being different syllables. As this is now pronounced in English like the single syllable air-, the sign of separation is no longer used. This sign (and this process) is called diaeresis.

It is used in French names to the same effect, as in Noël 'Christmas', Citroën (as opposed to citron 'lemon'). The accent is called tréma in French. Rudra pointed out to me a single instance of its use in a common word (i.e. not a proper name) in modern French for this function: canoë is pronounced canoé. Although it is written in the name of the composer Saint-Saëns, I have never heard it pronounced as diaeresis there. It is also used in Dutch in the same way in a few words, such as België (Belgium). Any use in this way in other languages is probably as sporadic borrowing from French. Until an 1878 spelling reform it was also used in poëme, poësie, now poème, poésie.

Another use in French is to indicate a U is separately pronounced, so aigu 'acute' would regularly have feminine aigue; but as that looks like it's pronounced ending in [g], the tréma is used on the E, aiguë. There is a 1990 proposed spelling reform that would make it the more logical aigüe, but this has not been widely adopted.

It could be used in Middle English, but more usually the separate e is written è. However, Tolkien used it in this way, to indicate separate syllables (Fëanor, whereas ea was a diphthong in Old English), and a final pronounced e as in Ainulindalë. It also occurred more widely in Old French, as in emperëor.

It is rarer to find it used as a vowel of changed sound, but it so occurs in Albanian, where it represents a neutral vowel.

It also occurs in Russian, where it represents the sound yo. So the common names Pyotr and Fyodor (Feodor) are written Pëtr and Fëdor (in Cyrillic, Пётр and Фёдор). After ch or sh it represents not yo but o, as in Gorbachëv, which whether you spell it in Roman letters as Gorbachev or Gorbachov, is pronounced Gor-ba-CHOF. (Actually it's Gar-ba-CHOF, but that takes us away.) So also Khrushchëv = Khrush-CHOF. An important thing about this letter is that it is always stressed.

Historically E and O are related (in fact such an alternation goes back very deep in Indo-European). Inflected forms can change the Ë back to an ordinary E, as in the patronymic Petrovich and the female Gorbacheva.

The HTML code for ë is ë and for Ë you use Ë
Thanks to Albert Herring for reminding me about Dutch, and to Rudra for a reminder of aiguë.

Detailed history of French orthography including accentuation: