# What does continuity of a function mapping a topological space to a real line interval mean?

It makes sense for continuity to be defined on a function mapping a real line to a real line. Or how continuity is defined on a function between two topological spaces (every preimage of an open set is an open set). But what does, continuity on a function between a topological space and real line interval mean? Like in Urysohn's Lemma.

Is it just defined in a particular way or one can derive its meaning by looking at how continuity is defined b/w two topological spaces and two real line intervals?

I'm not very good with words so I hope the question made some sense.

It is defined in the same way continuity between any two topological spaces is defined - so the question boils down to if an interval $I$ of the real line is a topological space, then what is the topology?
We usually endow the real line with the Euclidean metric, which induces a topology whose open sets are open intervals and unions of open intervals. But what if the space we're in is an interval of the real line? Given an interval $I \subset \mathbb{R}$, it is natural to give it the subspace topology, wherein we take the open sets to be the open sets of the real line intersected with $I$. As a concrete example, if $I = [0, 1]$, then the sub-interval $(1/2, 1]$ is open in $I$ under the subspace topology since $(1/2, 1] = (1/2, 2) \cap I$, and $(1/2, 2)$ is an open set in $\mathbb{R}$.
We have thus induced a topology on $I$, so given a topological space $X$, any function $f:X \rightarrow I$ is continuous whenever the preimage of any open set in $I$ is an open set in $X$.