A function f is said to be surjective or onto, if for every y in the codomain, there is at least one x in the domain such that f(x) = y.
as y =f(x) = x^3- x = x(x^2-1)
It takes the value from -infinite to + infinite and contnuous so for each y there is an x and hence it is surjective
A function f from A to B is said to be injective if different elements in A have different images in B.
Now, f(-1) = f(0) = f(1) = 0, so f cannot be injective.