It occurs to me that people most likely already know how to explicitly integrate over fractals, but my method (edit: seems to have been highlighted out in a paper, see comments) seems to vastly simplify the process (So even a comparative layman like me can do it).
Firstly, we'll be integrating with respect to measure, since the cantor set is obviously discontinuous. I'll also be interpreting the result of integrating the cantor set as $1.63...=1+0.63$ dimensional (correct me if I'm wrong). If your interested I've been investigating this for a while: the inspiration and the investigation.
We want to find $\int_C f(x) d \mu(x)$ where the integral is taken over the entire cantor set. We'll let $f(x)=x$ to start. Here's my trick, instead of directly evaluating the integral, redefine the integral in terms of itself. The cantor set is identical under a transformation that thirds the length of the set and places on at $0$ and one at $2/3$. We'll use that now.
$$\int_C x \ d\mu (x)=\int_{C/3} x \ d\mu (x)+\int_{C/3} x+{2 \over 3} \ d\mu (x+{2 \over 3})$$
The measure we are using is uniform and defined to evaluate to 1 under the integration scheme, so we can simplify the part on the right hand side.
$$\int_C x \ d\mu (x)=\int_{C/3} x \ d\mu (x)+\int_{C/3} x+{2 \over 3} \ d\mu (x)=2 \cdot \int_{C/3} x \ d\mu (x)+\int_{C/3} {2 \over 3} \ d\mu (x)$$
Now do this recursively.... $$\int_{C} x \ d\mu (x)=4 \cdot \int_{C/9} x \ d\mu (x)+2 \cdot \int_{C/9} {2 \over 9} \ d\mu (x)+\int_{c/3} {2 \over 3} \ d\mu(x)$$
$$\int_{C} x \ d\mu (x)=8 \cdot \int_{C/27} x \ d\mu (x)+4 \cdot \int_{C/27} {2/27} \ d\mu (x)+2 \cdot \int_{C/9} {2 \over 9} \ d\mu (x)+\int_{c/3} {2 \over 3} \ d\mu(x)$$
Time for assumptions. I'll assume the first term in this eventually infinite series becomes 0, and we'll be left with...
$$\int_{C} x \ d\mu (x)=0+2^{N-1} \cdot \int_{C/{3^N}} {2 \over {3^N}} \ d\mu (x)+...+4 \cdot \int_{C/27} {2 \over 27} \ d\mu (x)+2 \cdot \int_{C/9} {2 \over 9} \ d\mu (x)+\int_{c/3} {2 \over 3} \ d\mu(x)$$
Where N indicates the number of times the equation has been iterated. We now notice that when you third the cantor set, you only half the measure of the resulting set...
$$\Rightarrow \int_{C} x \ d\mu (x)=\sum_{j=1}^N \left( {{2^{j-1}} \cdot 2} \over {3^j \cdot 2^j} \right)$$
As $N$ approaches infinity, this sum converges to ${1 \over 2}$
$$\Rightarrow \int_{C} x \ d\mu (x)={1 \over 2}$$
Questions:
Did I get the right result? I expected something different from 1/2 since the cantor set has a different dimensionality than just a typical line. My method seems to be able to handle more than just the ternary cantor set, in fact it also gives consistent results when applied to the line.
I should also mention that since we know the value for $f(x)=x$ we can derive the result for $f(x)=x^2$ in a very similar way.
There is a wonderful paper in the April 2000 issue of the Monthly by Bob Strichartz entitled "Evaluating Integrals Using Self-Similarity". The MAA has PDF copy here. You've effectively got the basics of this technique, though, there is much more that one can do.
In general, any self-similar set supports a multitude of self-similar measures and you can use the self-similarity to integrate with respect to those measures. A recursive procedure, like yours, can be used to compute the integral of any polynomial. We can also use the self-similarity to generate a numerical procedure to estimate integrals of more arbitrary functions.
As you note, the unit interval is self-similar and it's not too hard use this to prove that $$\int_0^1 x^n \, dx = \frac{1}{n+1}.$$ However, other ways of decomposing the interval into intervals of different sizes or just weighting the subparts different amounts leads to other self-similar measures on the interval.
And, yes, your computation is certainly correct - as is Jack's.
It's all really quite beautiful stuff.