MATLAB, 41 bytes
function x=g(f,x);while f(x)-x;x=f(x);end
There is also this beauty that does not need function files. Unfortunately it is a little bit longer:
i=@(p,c)c{2-p}();g=@(g,f,x)i(f(x)==x,{@()x,@()g(g,f,f(x))});q=@(f,x)g(g,f,x)
function x=g(f,x);while f(x)-x;x=f(x);end
There is also this beauty that does not need function files. Unfortunately it is a little bit longer:
i=@(p,c)c{2-p}();g=@(g,f,x)i(f(x)==x,{@()x,@()g(g,f,f(x))});q=@(f,x)g(g,f,x)