Taimanov's extension theorem [collecting applications] In a topology course we proved the following theorem:

Let $X$ be any space, $D \subseteq X$ dense, $Y$ a compact $T_3$ space and $f: D \to Y$ be any continuous map, s.t. for all disjoint closed $A, B \subseteq Y$: $\overline{f^{-1}(A)} \cap \overline{f^{-1}(B)} = \emptyset$ holds (the closure regards to $X$). Then there is a continuous extension of $f$ to $X$.

This theorem seems quite powerful to me, because its proof involves many filter/ultrafilter computations, but nevertheless I don't know a single application. Can you name some to me?
Thank you in advance!
//edit:
@Henno Brandsma, Paulo H.: thank you for your really interesting answers!
I still wonder, whether there are further applications outside general topology (e.g. analysis, measure theory). Are there particular functions which become surprisingly easy to define using this theorem (note that there is a unique extension, if $Y$ is additionally Hausdorff)?
 A: Engelking has this as theorem 3.2.1. in my edition. He goes on to prove the following consequence: every compact Hausdorff space that has a base of cardinality $\le \kappa$, for some infinite cardinal $\kappa$, is the continuous image of a closed subset of the Cantor cube $\{0,1\}^\kappa$.
In the proof he embeds $X$ into $S^\kappa$, so we assume $X \subset S^\kappa$, where $S$ is the Sierpinski space $\{0,1\}$ (with $\left\{0\right\}$ as the only non-trivial open set), using an earlier theorem on universal embeddings; the "identity" map $h$ from $\{0,1\}^\kappa$ onto $S^\kappa$ is continuous, and then the theorem above is applied for $D = h^{-1}[X]$, and its closure (say $Y$) in the Cantor cube and $X$ as the co-image, and $h$ as the function.
After checking this he can extend $h$ to $Y$ and then $Y$ is the required closed subspace of the Cantor cube. 
(There are other ways to prove it, of course, e.g. using that the standard Cantor set maps onto $[0,1]$ and using the embedding into Tychonoff cubes)
Other consequences are hard for me to find, because books are normally not indexed so that we can easily find consequences of a given theorem, e.g. 
Engelking mentions that this result is due to Taimanov, 1952, a paper in Russian.
A: There is another applications of this theorem. It is also in Engelking's General Topology, enumerated as Theorem 3.5.5: 
Compactification $c_1 X$ and $c_2 X$ of a space $X$ are equivalent if, and only if, for every pair of closed subsets $A,B\subseteq X$ we have
$$ \Big( \overline{c_1[A]}\cap\overline{c_1[B]} = \emptyset \Big)\leftrightarrow \Big (\overline{c_2[A]}\cap\overline{c_2[B]} = \emptyset \Big)$$
The proof is based on the map $h_i: c_i [X]\to X$ given by the restriction $c_i|_X$, for $i\in\{ 1,2\}$. As $c_i[X]$ is dense in the compactification $c_i X$, there is extensions $C_2:c_2X\to c_1X$ and $C_1:c_1X\to c_2X$ of the functions $c_1h_2: c_2[X]\to c_1 X$ and $c_2h_1:c_1[X]\to c_2 X$, such that $C_2\circ c_2 = c_1$ and $C_1\circ c_1 = c_2$.
Also, the reciprocal of Taimanov's theorem is true.
