This is because you're not applying the right methodology for accepting inputs from input. What you are actually doing with f is that you're creating an anonymous function where if you run this, it will then ask you for input from the user. If you actually typed in this statement with your f variable as is, nothing would happen. Something would only happen if you typed in f() (or technically, f can be any input, but because the input variable for the anonymous function isn't being used in how you specified it, we can get away with specifying no inputs) in the command prompt to call this function, and then pushed ENTER. Even when you do this, the output of this function would only store a string, and you need to use this to create an anonymous function.
To fix this, what I would do is use input to store your function as a string. Take note that you need to add a second parameter for input, which is a string flag 's'. Without this, input would be expecting a number, and this obviously wouldn't work. After this, use str2func to turn this into an anonymous function, and then run your bisection method. str2func accepts in a string, and then converts that string into an actual MATLAB function and you can now use this for your purposes. By accepting your anonymous function as a string, you can place any operators you want to your heart's content, so long as the way you place them are syntactically valid. Also, make sure that your function is defined in terms of x like your example in your post.
As such do this:
funcString = input('Input a function: ', 's'); %// Make sure you specify 's'!
f = str2func(['@(x) ' funcString]);
A = [0 2];
z = myBisection(f, A);
Put this inside a .m file, then run this file. It should behave like you are expecting.