Let $f$ be the function defined as follows.
Let $\mathcal C$ be the Cantor set and let $I_{n,k}$ be the open intervals removed in increasing order of left endpoint at the $n$-th step. So there are $2^n$ $I_{n,k}$'s for each $n$.
For each $n,k$, let $g_{n,k} : [0,1]\to [0,2^{-n}]$ be a continuous function with $g_{n,k}(x)=0$ for $x\not\in I_{n,k}$ and $0 < g_{n,k}(x) \leq 2^{-n}$ for $x\in I_{n,k}$. We can explicitly construct such a function $g_{n,k}$ by writing $I_{n,k} = (a,b)$ and then defining $g_{n,k}(x)$ to be $- 2^{-n} \frac{x-b}{(b-a)/2}$ for $x\in [(a+b)/2, b]$ and $g_{n,k}(x)$ to be $2^{-n}\frac{x-a}{(b-a)/2}$ for $x\in [a,(a+b)/2]$.
Now let $f(x) = \sum_{n,k} (-1)^n g_{n,k} (x)$.
Prove that $f$ is continuous. Prove that $f$ crosses the $x$-axis at every point in $\mathcal C$. That is, for every $a\in\mathcal C, f(a)=0$ and for all $\delta > 0,\exists x,y \in (a-\delta, a+\delta)$ with $f(x)<0$ and $f(y)>0$.
As for the proof that $f$ is continuous, I think the Weierstrass M-test could be useful, but clearly a better bound is needed than just the fact that $g_{n,k} \leq 2^{-n}$ for each $x\in I_{n,k}$. One can just replace $2^{-n}$ with $2^{-n-k}$ in the definition of $g_{n,k}$ to resolve this issue, but then I'm not sure if $f$ still crosses the x-axis at every point in $\mathcal C$. I know that for any point in $\mathcal C$, $f$ is definitely zero due to the definitions of the $g_{n,k}$'s though.
$f(x)$ is continuous
Let $\displaystyle{g_n(x)=\sum_{k=1}^{2^n} g_{n,k} (x)}$ for $x\in[0,1]$. Since $g_n(x)$ is a sum of nonnegative functions with disjoint supports, each of which is bounded by $2^{-n}$, we know $0\le g_n(x)\le 2^{-n}$.
$$f(x)=\lim_{n\to\infty}f_n(x),$$ where $f_n(x)=\sum_{i=1}^n(-1)^i g_i(x)$.
Since $|f(x)-f_n(x)|=|\sum_{i=n+1}^\infty(-1)^i g_i(x)|$ $\le \sum_{i=n+1}^\infty|g_i(x)|$ $\le\sum_{i=n+1}^\infty2^{-i}$ $=2^{-n}$, $\ f_n(x)$ converges uniformly to $f(x)$. Thanks to the uniform limit theorem, we know $f(x)$ is continuous.
$f$ crosses the $\text x$-axis at every point in $\mathcal C$
I will use $\underline{0.d_1d_2\cdots}$ to represent the number $\sum_{i=1}^{\infty}d_i{3^{-i}}$ in base $3$.
Let $a\in\mathcal C$. Then $a=\underline{0.a_1a_2\cdots}$, where each digit $a_i\in\{0,2\}$.
Let $\delta>0$. Then $\delta>\underline{0.\overbrace{00\cdots0}^{e-1\text{ 0's}}1}$ for some positive integer $e$.
Consider two open intervals near $a$, $$(\underline{0.a_1a_2\cdots a_e1}, \underline{0.a_1a_2\cdots a_e2})$$ and $$(\underline{0.a_1a_2\cdots a_e01}, \underline{0.a_1a_2\cdots a_e02}).$$ Since $a-\delta<\underline{0.a_1a_2\cdots a_e}$ and $ \underline{0.a_1a_2\cdots a_e2}<a+\delta$, both intervals are subsets of $(a-\delta, a+\delta)$.
During the construction of $\mathcal C$, the first interval above is removed at the $e{+}1$-th step. (This can be proved straightforwardly by induction.) Suppose it is $I_{e+1, j_1}$ for some $j_1$. Then $$f(x)=(-1)^{e+1}g_{e+1, j_1}(x)\quad\text{when }x\in I_{e+1,j_1}.$$ Similarly, the second interval above is $I_{e+2, j_2}$ for some $j_2$. $$f(x)=(-1)^{e+2}g_{e+2, j_2}(x)\quad\text{when }x\in I_{e+2,j_2}.$$
Note one of $(-1)^{e+1}$ and $(-1)^{e+2}$ is positive and the other one is negative. Since $g_{n,k}$ are positive on $I_{n,k}$ for all $n$ and $k$, we see that $f(x)>0$ when $x$ is in one of the those two intervals while $f(x)<0$ when $x$ is in the other interval. The proof is complete.