It happens because of operator precedence - google will help you with that - so it does make some sense.
I wouldn't do that - it isn't obvious what you actually want to happen, and that makes it difficult for a mere mortal to comprehend at a glance - the way most people read code. Re work it to two lines: It both makes it clearer for us, but also for the compiler:
float g = f / 4 + f * 2 / (f + 1);
f++;
I would also tend to add more brackets to make it absolutely obvious - but then, I've translated code between languages before...
float g = (f / 4) + ((f * 2) / (f + 1));
f++;