Let $\Delta$ be the middle-thirds Cantor set, and let $F$ be a non-empty closed subset of $\Delta$. Then $[0,1]\setminus F$ is an open set in $[0,1]$, so it is the union of a countable family $\mathscr{I}$ of pairwise disjoint open intervals in $[0,1]$. (Note that intervals of the forms $[0,a)$ and $(a,1]$ are open in $[0,1]$.) Let $I=(a_I,b_I)\in\mathscr{I}$; clearly $a_I,b_I\in F$. $\Delta$ does not contain any non-empty open interval, so there is an $x_I\in(a_I,b_I)\setminus\Delta$. Now define
$f:\Delta\to F:x\mapsto\begin{cases} x,&\text{if }x\in F\\ a_I,&\text{if }x\in(a_I,x_I)\text{ for some }I\in\mathscr{I}\\ b_I,&\text{if }x\in(x_I,b_I)\text{ for some }I\in\mathscr{I}\;. \end{cases}$
Can you prove now that $f$ is continuous?
Added: If $0\notin F$, there will be an $I\in\mathscr{I}$ of the form $[0,b)$; in that case take $x_I=0$. Similarly, if there is an $I\in\mathscr{I}$ of the form $(a,1]$, set $x_I=1$. In these two cases you want $f$ to squash all of $I\cap\Delta$ to the endpoint of $I$ that is in $F$.