You want to remove the discontinuity produced by $ x-1 $ in the denominator so $ f(x) $ should have $ (x-1) $ as one of the factors
With this knowledge, let's say $ f(x) = (x-1) \cdot a $
\begin{align}
\frac{(x-1)\cdot a}{(x-1)(x-2)} = &-3 \\
\frac{a}{(x-2)} = &-3 \\
a = & -3(x-2) \\
a = & -3x + 6 \\
\end{align}
So one option could be $ f(x) = (x-1)(-3x+6) $ or expanded: $ -3x^2 + 9x - 6 $
As the $ x\to 1 $ the denominator, once the discontinuity is removed, tends to $ -1 $ so any numerator that includes $ x-1 $ and another factor that equals to $ 3 $ will be a solution.
Another option: $ f(x) = 3(x-1) = 3x-3 $