# [MATLAB], 41 bytes

<!-- language-all: lang-matlab -->

    function x=g(f,x);while f(x)-x;x=f(x);end

There is also [this beauty](https://tio.run/##FclLCoAgGEXh7dwLNqipCG7FHkoQWRmhSGu3v8kZfCdOt3uW1oKxCLTwKrNaMCtJEBIpfOvQoRiPTGMyX1D/r@l5TQfcnmBl@S3GC@m8brgxCZCqJ3X7AA) that does not need function files. Unfortunately it is a little bit longer:

    g=@(g)@(f,x){@()x,@()g(g)(f,y)}{2-(y=f(x)==x)}();g(g)

[Try it online!][TIO-jay9sznn]

[MATLAB]: https://matlab.mathworks.com/
[TIO-jay9sznn]: https://tio.run/##y08uSSxL/f8/rTQvuSQzP0@hwjZdI02nQtO6PCMzJ1UhTaNCU7fCusIWxLBOzUv5D8TWKZnFBRrpGg5AMSPdCh1DTU3r/wA "Octave – Try It Online"