Answer
$$\frac{2\left(x-1\right)^2}{x}$$
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{x^2-1}{x}\times \frac{2x-2}{x+1}\\ \frac{\left(x^2-1\right)\left(2x-2\right)}{x\left(x+1\right)}\\ \frac{2\left(x+1\right)\left(x-1\right)^2}{x\left(x+1\right)}\\ \frac{2\left(x-1\right)^2}{x}$$