First of all it has to evaluate the condition (f(0) == 0) to determine whether it is true or false. As a result it calls function f() to find the value of f(0). Then it has to call f() again ...
If you have a debugger you can step through the code line by line, place a breakpoint in each function to see this.
Actually, I think the correct code might look like this,