You cannot "solve for f" here. However, you can find the zeros/roots of f. Set f = to 0. Then, one by one, set each of the factors = to 0 and solve for x:
x+1=0 results in x=-1; x-5=0 results in x=5, and so on.
Thus, the solutions of f(x)=0 are {-1, 5, -3, 4, 8}