Answer
$$\frac{\left(x-1\right)^2}{\left(x-2\right)^2}$$
Work Step by Step
Recall, one never divides by a fraction. Rather, if we want to divide by a fraction, we multiply by the reciprocal of the fraction. Recall, the reciprocal of a fraction is that fraction with the numerator and the denominator switched. Thus, we find:
$$ \frac{\left(x^2-1\right)\left(x^2+x-2\right)}{\left(x^2-4\right)\left(x^2-x-2\right)}\\ \frac{\left(x+1\right)\left(x-1\right)^2\left(x+2\right)}{\left(x+2\right)\left(x+1\right)\left(x-2\right)^2}\\ \frac{\left(x-1\right)^2}{\left(x-2\right)^2}$$