This question seems quite straightforward, but it isn't. Let $f^{-1}(x)=g(x)$
$f(x)=\left\{\begin{array}{l}x^3-1, x<2\\x^2+3,x\geq2\\\end{array}\right.$
$f(g(x))=x$
If $x<2,(g(x)) ^3=x+1 \implies g(x)=(x+1)^{1/3}, x<2$
Similarly, if $x\geq2, g(x)=(x-3)^{1/2}$. We know that $f(x)$ is one one function, so it passes the horizontal line test.
However my book says $g(x)=\left\{\begin{array}{l}(x+1)^{1/3}, x<7\\(x-3)^{1/2},x\geq7\\\end{array}\right.$
Edit 1: The strange thing is that when I substitute values, the answer given in my books seems correct, even though it doesn't make sense mathematically.
Edit 2: Since we have to consider the domain of another variable $y$ is it appropriate to write the inverse as a function of $x$.
How did this happen?
Hint:
Consider the case $x<2$. Then $y = f(x) = x^3-1$ and let $g(y)$ denote the inverse. Since $x<2$ we see that $y < 2^3-1=7$. So $x = (y+1)^{\frac13} = g(y)$ where $y <7$. So when $y<7$ we have $g(y) = (y+1)^{\frac13}$.
I hope that you can do the other part as well.