Given f(x)=x^2+4 and g(x)=3x+1 simplify g^-1(x)(inverse)

please show work and explain

g^-1(x) = (x-1)/3

solve for x and then swap names:

g=3x+1
3x = g-1
x = (g-1)/3