This question may be insanely simple, but I'm unsure.
Let's say we have the following function: $$ f(x) = \begin{cases} x & 0 \leq x < 1 \\ x-1 & 1 \leq x < 2 \\ 0 & \text{otherwise} \end{cases}$$
The CDF is obviously $$ F(x) = \begin{cases} \frac{1}{2}x^2 & 0 \leq x < 1 \\ \frac{1}{2}x^2-x+1 & 1 \leq x < 2 \\ 0 & \text{otherwise} \end{cases} $$
How would I calculate the Inverse CDF from this?
(Note: The +1 is required to make it add to 1 and not suddenly become negative. I don't know if that matters for the Inverse CDF.)