This is on the same theme as in this post, where the Fourier transform was derived using simple function.
Let $f:[0,1] \to [0,1]$ be the Cantor function.
Then $f$ is the cumulative distribution of a Cantor distributed random variable $$ X=\sum_{n=1}^\infty 3^{-n} Y_n $$ where the $Y_n$ are i.i.d. and takes values $0$ and $2$ with equal probability.
In this MO post, it is stated that $$ E(e^{itY_n})=e^{it/2}\cos(3^{-n} t). $$
How do we get that? I have $$ E(e^{itY_n})=\frac{e^{it2/3^n}+1}{2}. $$
Also, it is stated in the post that $$ \hat f(t)=\frac{1}{it} -\frac{1}{it}\hat {f'}(t). $$
How do we get this one? I thought $$ \hat f(t)=\frac{1}{it}\hat {f'}(t) $$ only.