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)?

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.
