You did well in presenting the problem with your "over this and that" approach. However, you didn't explain in words that your task was to solve this for f.
To solve for f, take the entire (1/f) fraction above and invert it:
1/b f = ------------- (1/a) + 1
This could be simplified; the LCD is ab. Give that a try.