Anyway, thanks Ricky! I'm not sure I'll understand all of that proof, but it's good that we have an answer.

]]>So either it doesnt exist, or, if it does, it wont be totally undifferentiable. However, I agree that most likely it wont be expressible as a nice and neat formula (if it exists). Thats my theory.

]]>If that is incorrect then ignore the rest of this post. But if it is true then I don't think that any such function could be continuous. Further guesswork leads me to believe that there would be at least one irrational x where f(x) = m that would not have a limit because f(x) would oscillate infinitely many times between m and various irrational numbers no matter how close you approached x. Basically it would behave like sin(pi/x) near x = 0.

I'm sorry if my explanation isn't clear, if something I wrote doesn't make sense I can try to explain it better. Of course, I'm probably wrong anyway, but maybe it can lead you in the right direction.

]]>so

Replacing those right-arrows with left or double arrows is allowed, so by using double arrows we have that my condition is equivalent to yours.

Unfortunately, that means your trivial solution won't work.

]]>I wrote:

What do you think means?

Now stop asking stupid questions!

]]>What do you think means? ]]>

If not the question is trivial: just let f(x) = c where c is any irrational number.

]]>(Or prove that such a function doesn't exist)

Can anyone shed light on this?

Edit: Just remembered, the question doesn't actually require you to find an example of such a function. Proving its existence would be enough.

]]>