To add to the comments made so far:
Proposition. Let $X$ and $Y$ be nonempty sets.
If $\mathscr{I}=\{\emptyset,Y\}$ is the indiscrete topology on $Y$, then for every topology $\tau$ on $X$, every map $f\colon (X,\tau)\to (Y,\mathscr{I})$ is continuous.
If $\mathscr{D}=\mathcal{P}(X)$ is the discrete topology on $X$, then for every topology $\sigma$ on $Y$, every map $g\colon (X,\mathscr{D})\to(Y,\sigma)$ is continuous.
Proof.
Let $f\colon(X,\tau)\to(Y,\mathscr{I})$ be any map. Then $f^{-1}(\emptyset)=\emptyset\in\tau$, $f^{-1}(Y)=X\in\tau$, so the inverse image of every open set in $(Y,\mathscr{I})$ is open in $(X,\tau)$, so $f$ is continuous.
Let $g\colon(X,\mathscr{D})\to(Y,\sigma)$ be any map. Then for every $\mathscr{O}\in\sigma$, $g^{-1}(\mathscr{O})\subseteq X$, hence $g^{-1}(\mathscr{O})\in\mathscr{D}$. Thus, the inverse image of every open set in $(Y,\sigma)$ is open in $(X,\mathscr{D})$, so $g$ is continuous. QED
This is a consequence of the fact that endowing a set with the indiscrete topology is the right adjoint of the underlying set functor from $\mathcal{T}op$ to $\mathcal{S}et$, while endowing it with the discrete topology is the left adjoint.
That is: define $\mathscr{U}$ to be the functor from the category of topological spaces to the category of sets to be the forgetful/underlying set functor: given any topological space $(X,\tau)$, $\mathscr{U}(X,\tau)$ is just the set $X$; and given any continuous map $f\colon (X,\tau)\to(Y,\sigma)$ between topological spaces, $\mathscr{U}(f)$ is the set-theoretic function between $X$ and $Y$ that corresponds to $f$. This is a functor in the sense of category theory.
Define $\mathscr{I}$ to be the functor from the category of sets to the category of topological spaces defined by taking a set $X$ to the topological space $\mathscr{I}(X) = (X,\{\emptyset,X\})$, that is, $X$ endowed with the indiscrete topology; and that takes any set-theoretic map $f\colon X\to Y$ to the continuous map $\mathscr{I}(f)\colon (X,\{\emptyset, X\})\to(Y,\{\emptyset, Y\})$ that is defined on $X$ by $f$ itself. This is continuous by the first clause of the proposition above. Again, it is easy to verify that this is a functor. It is called the indiscrete topology functor.
Given a set $Y$ and a topological space $(X,\tau)$, there is a natural bijection between the set of all set-theoretic functions from $X=\mathscr{U}(X,\tau)$ to $Y$, $\mathcal{S}et(X,Y)$, and the set of all continuous functions between the topological spaces $(X,\tau)$ and $(Y,\{\emptyset,Y\})=\mathscr{I}(Y)$. That is, we have a natural bijection
$$\mathcal{S}et\Bigl(\mathscr{U}(X,\tau), Y\Bigr) \stackrel{\cong}{\longleftrightarrow} \mathcal{T}op\Bigl( (X,\tau), \mathscr{I}(Y)\Bigr).$$
This says that $\mathscr{I}$ is the right adjoint of $\mathscr{U}$.
Likewise, given any set $X$, define $\mathscr{D}$ to be the function that takes the set $X$ to the topological space $\mathscr{D}(X,\mathcal{P}(X))$, that is, $X$ endowed with the discrete topology; given a set-theoretic map $f\colon X\to Y$, we get a continuous function $\mathscr{D}(f)\colon \mathscr{D}(X)\to\mathscr{D}(Y)$; this is again a functor from the category of all sets to the category of topological spaces. It is called the discrete topology functor.
Given any set $X$ and any topological space $(Y,\sigma)$, there is a natural bijection between the set of all set-theoretic functions from $X$ to $\mathscr{U}(Y,\sigma)=Y$, and the set of all continuous functions between the topological spaces $\mathscr{D}(X)$ and $(Y,\sigma)$. That is, we have a bijection
$$\mathcal{T}op\Bigl( \mathscr{D}(X), (Y,\sigma)\Bigr) \stackrel{\cong}{\longleftrightarrow} \mathcal{S}et\Bigl( X, \mathscr{U}(Y,\sigma)\Bigr),$$
so that $\mathscr{D}$ is the left adjoint of the underlying set functor.
Because $\mathscr{I}$ is the right adjoint of the underlying set functor, any function into a space with the indiscrete topology is necessarily continuous. Because $\mathscr{D}$ is the left adjoint of the underlying set functor, any function from a space with the discrete topology is necessarily continuous.
Related to your question, if you endow $[0,1]$ with the discrete topology, then you can put any topology on $(0,1)$ and then use any functions whatsoever to answer the question; if you endow $(0,1)$ with the indiscrete topology, then you can put any topology on $[0,1]$ and any function $(0,1)\to[0,1]$ will be continuous.