We have the following cumulative distribution function:
$$ F(x) = \begin{cases} 0 & x < 0 \\ x^2/9 & 0 \le x \le 3 \\ 1 & x > 3 \end{cases} $$
To find $X$ in terms of $U \sim \mathrm{Uniform}[0, 1]$:
$$ F^{-1}(u)=\min\{x: F(x) \ge u\}=\min\{x: x^2/9 \ge u\}=\min\{x: x \ge 3 \sqrt{u}\}=3\sqrt{u}$$
$$X =F^{-1}(U)=3\sqrt{U}$$
However suppose now that:
$$ F(x) = \begin{cases} 0 & x < 1 \\ x^2/9 & 1 \le x \le 3 \\ 1 & x > 3 \end{cases} $$
Following the same steps as above, we would have:
$$ X =F^{-1}(U)=3\sqrt{U}$$
This doesn't seem right since the steps don't seem to take into the account the different range of values for $x$. I'd like to know what the correct approach is.