Let y=f(x)=-3x+6.
Now write x in terms of y:
3x=6-y, x=(6-y)/3=2-y/3.
Let x=g(y)=2-y/3, so g(x)=2-x/3 or -x/3+2
g(x) is the inverse of f(x), that is, g(x)=f-1(x).
g(f(x))=-f(x)/3+2=-(-3x+6)/3+2=-(-x+2)+2=x-2+2=x;
f(g(x))=-3g(x)+6=-3(-x/3+2)+6=x-6+6=x.
So g(f(x))=f(g(x))=x which confirms that g(x)=-x/3+2 is the inverse of f(x).