Could someone please just confirm if my answers are correct im looking for the inverse of the following function. (this is for a programming assignment x is a variable i will be taking from the user then subbing into formulas)

f(x)= 3x+2

g(x)= 8x^3

inverse of f(x) = (x-2)/3;

inverse of g(x) =cubed root of 8 * x

that second one is wrong i think, i've been looking at vids online but i cant figure out how to inverse 8x^3 could any one help me