[Answer](https://math.stackexchange.com/a/5124131/125918) from math stack exchange (I looked up the user [online](https://www.google.com/search?q=Gevorg+Ayvazyan+mathematician&sca_esv=e8bb71c9cc7ce2dd&sxsrf=ANbL-n5HqHMIzgZiKyRSP0LhmRWE2gL9fw%3A1770840363594&ei=K-GMaZ-CJLGlptQPgcOPuQk&ved=0ahUKEwjfw822ntKSAxWxkokEHYHhI5cQ4dUDCBM&uact=5&oq=Gevorg+Ayvazyan+mathematician&gs_lp=Egxnd3Mtd2l6LXNlcnAiHUdldm9yZyBBeXZhenlhbiBtYXRoZW1hdGljaWFuMgUQIRigATIFECEYoAEyBRAhGKABMgUQIRigATIFECEYoAFI8B9QmgdYyB1wAXgAkAEAmAHYAaABpA6qAQYyLjEyLjG4AQPIAQD4AQGYAg-gApgOwgIIEAAYgAQYsAPCAgcQABiwAxgewgIJEAAYsAMYCBgewgIOEAAYgAQYsAMYhgMYigXCAgsQABiABBiwAxiiBMICBhAAGBYYHsICCxAAGIAEGIYDGIoFwgIIEAAYgAQYogSYAwCIBgGQBgaSBwYyLjEyLjGgB6otsgcGMS4xMi4xuAePDsIHBjAuMi4xM8gHPIAIAA&sclient=gws-wiz-serp) and I am not sure he specializes in mathematics; therefore, take his answer with a pinch of salt):
> Yes, the [other user](https://www.dropbox.com/scl/fi/vj39slay0v3veweufsmdl/Math_Stackoverflow.pdf?rlkey=i9x8nfmqoibq678uy6mcdbpdu&e=1&st=60heuids&dl=0) is right. The expected value is not undefined because the graph has Hausdorff dimension 2 or zero 2-D Hausdorff measure; that’s irrelevant since expectation integrates over the domain, not the graph. The real reason is that an everywhere-surjective function on every subinterval must be wildly pathological and cannot be Lebesgue-integrable, so the integral defining the expectation fails to exist. The geometry of the graph doesn’t determine integrability; it’s the function’s behavior as a measurable function on (c,d) that matters.