Error with package ApproxFun

This sounds like you have used some constant called f so redefining it to f = sin(x^2) fails. I suggest restarting Julia (if you have had a variable f) or renaming your function to something else.