Answer:
In order to make g as the subject, we have only g on the left side and rest of the terms are denoted on the right. So, we consider it as X=3g+2 and switch to other side's 3g+2=x. It has to divide both sides by 3 and literally consider for g=1/3x-2/3 and therefore answer is g=1/3X-2/3.