Let y=f(x)=3x-15, 3x=y+15, x=y/3+5.
Let g(y)=x, then g(y)=y/3+5, so g(x)=x/3+5 just by replacing y with x (as placeholder).
But g(x)=f-1(x)=x/3+5.
CHECK
f(f-1(x))=f-1(f(x))=x should be true.
f(x/3+5)=3(x/3+5)-15=x+15-15=x OK.
f-1(3x-15)=(3x-15)/3+5=x-5+5=x OK.
So f-1(x)=x/3+5.