Let $S = \displaystyle \prod_{n \ge 1} \{ 0, 1\}$ be the set of binary sequences, so $S$ with the product topology is homeomorphic to the Cantor set. Endow $\mathbb{Z}_{\ge 1} \cup \{ \infty \}$ with the subspace topology from the extended real line, so basic open subsets are either singletons of integers, or sets of the form $U_n = \{ a > n : n \in \mathbb{Z} \} \cup \{ \infty \}$.
Define an "index function" $d:S \to \mathbb{Z}_{\ge 1} \cup \{ \infty \}$ by taking $d(s)$ to be the position of the first 1, and $d(000...) = \infty$. For example, $d(00100111...) = 3$. Is $d$ continuous? The preimage of a singleton integer set $d^{-1}(n)$ is a basic open subset in the product topology, but $$ d^{-1}(U_n) = \{000...\} \cup \bigcup_{m\ge n} d^{-1}(n) $$ Since $S$ is homeomorphic to the Cantor set, $S$ has no isolated points so $\{000...\}$ is not open. Is $d^{-1}(U_n)$ open?