Suppose we have a cubic polynomial function $f:\mathbb{R}\to\mathbb{R}$ given by $$y=f(x)=ax^3+bx^2+cx+d,$$ where $a,b,c,d\in\mathbb{R}$ and $a\neq 0$. As far as I know there are two ways to find the inverse function of $f$, namely the Cardano method (where we use the depressed cubic equation) and the one with the hyperbolic functions.
Both methods have particular conditions for which they hold. For example, in the Cardano method with $t^3+tx+q$, we need $4p^3+27q^2 > 0$ where $p$ and $q$ are given by $\frac{3ac-b^2}{3a^2}$ and $\frac{2b^3-9abc-27a^2d}{27a^3}$, respectively.
Now, what if we have the polynomial function $y=-0.06x^3+0.9x^2+3x$ where it fails to be a bijection on its domain? Can we restrict the domain and still get an inverse function? For example, we can define $g:[0,5]\to[0,30]$ with $g(x)=-0.06x^3+0.9x^2+3x$, where $g$ is a bijection on its domain $[0,5]$.
I have tried using the Cardano method and the hyperbolic functions method to find the inverse function but both fail.
But from the graph below (the red line is $g$ and the green $h$), it is obvious that $g$ should have an inverse. So, I tried the following: reflect $g$ about $y=x$ and get $h(y)=-0.06y^3+0.9y^2+3y$. Checking now $$h(g(x))=x, \quad \text{and}\quad g(h(y))=y$$ should give the values of $x$ and $y$ such that $h$ is the inverse of $g$, right?
The issue here is that I don't know if I can force $g:[0,5]\to[0,30]$ and $h:[0,30]\to[0,5]$ with $g(x)=y\iff h(y)=x$.
Any hints or help would be appreciated.