First, subtract #color(red)(5/12g)# and add #color(blue)(fg)# to both sides of the equation to isolate the #f# terms on the left side of the equation:

#2/3f + color(blue)(fg) + 5/12g - color(red)(5/12g) = 1 - color(red)(5/12g) - fg + color(blue)(fg)#

#2/3f + fg + 0 = 1 - 5/12g - 0#

#2/3f + fg = 1 - 5/12g#

Next, factor an #f# out of each term on the left side of the equation:

#f(2/3 + g) = 1 - 5/12g#

Now, divide each side of the equation by #color(red)(2/3 + g)# to solve for #f# while keeping the equation balanced:

#(f(2/3 + g))/color(red)(2/3 + g) = (1 - 5/12g)/color(red)(2/3 + g)#

#(fcolor(red)(cancel(color(black)((2/3 + g)))))/cancel(color(red)(2/3 + g)) = (1 - 5/12g)/(2/3 + g)#

#f = (1 - 5/12g)/(2/3 + g)#