$$f(x)=\begin{cases} x^2-x &\quad x\geq0\\ -x, &\quad x< 0\\\end{cases}$$ (a) Is $f$ surjective? Find the range of the function. for $x\geq0$: $$x^2-x=x(x-1)$$ $$x=y^2-y=\left(y-\frac12\right)^2-\frac12$$ $$\sqrt{x+\frac12}+\frac12 = f^{-1}$$ $$\text{The domain of the inverse is: }x\geq\frac12\text{ so that is also the range of } f(x) $$
Now for $x<0$: $$-y=x$$ $$-x=f^{-1} $$ So the domain of the inverse of the second function can be anything, so the whole range of $f(x)=y$ would be: $y\in\mathcal R\text{ without the interval: } \left(0,\frac12\right]$
The next question: Is the function injective?
It is not injective since we have: for $x\geq0$: $$x(x-1)\text{ has two zeros, so we have: } x_1=0, \quad x_2 = 1, \quad f(x_1)=f(x_2),\quad x_1\neq x_2$$
Now also for $x<0$: $$y = -x $$ Because function is falling at every single point: $f^{'}(x)=-1$ the function is injective here. We could also say that $f(-x)=-(-x)=x\neq -x$ that's why it also is not injective.
Next question : Find the biggest interval that contains $0$ and that the function is injective. Also find the inverse of this function.
So we already know that when $x<0$ the function is injective. So let's see if $x\leq0$ is also injective. If I understand correctly this means that the function should not have two or more different domain values there, let's see if it does: $$\text{when x = 0 : }\,f(x)=x^2-x\quad \text{when we put $0$ as $x$ we get:}\,0$$
Now how to get inverse of the function that is on this interval? We know that $-x=y$ also has a $y=0$ value. So we can find the inverse of $g(x)=-x$, $x\leq0$ function. We get $g^{-1}(x)=-x$.
The last question: Find the preimage of the function $f^{-1}([0,1])$
I don't quite understand this last one. I am still going to post this under solution verification since I answered all the other questions and maybe made some mistakes.
a) Is $f: \mathbb{R} \rightarrow \mathbb{R}$ surjective?
No. The global minimum of $f$ is $x^* = 1/2$, where the function takes the value $1/4-1/2 = -1/4$. This is true because the function is decreasing but positive on $-\infty,0)$, strictly increasing and positive on $x>1$, and on the compact interval $[0,1]$, there is a unique critical point and the function is strictly convex. So $f:\mathbb{R} \rightarrow [-1/4,\infty)$.
b) Is $f$ injective?
No. Like you said, $x(x-1)=0$ has two solutions, 0 and 1, so $f$ is not one-to-one.
c) The function is injective on $(-\infty,1/2)$ and $(1/2,\infty)$, since it is strictly decreasing on the first interval and strictly increasing on the second.
d) The preimage of $[0,1]$ is $\{x:f(x) \in [0,1]\}$. That includes $[-1,0]$, but nothing less than $-1$; it does not include $(0,1)$, since those values are mapped to negative numbers. At $1$, the function is increasing and takes the value zero, and at the largest solution of $x(x-1)=1$, $(1+\sqrt{5})/2$, the function takes the value 1. At any value greater than 1, the function is above 1, and strictly increase, so no further values are included. So the preimage is $[-1,0] \cup [1,(1+\sqrt{5})/2]$.