The solution is easy if we employ $\, gf\bmod gh\, =\, g(f\bmod h)\ \ $ [mod Distributive Law]
$$\begin{align}f(x)\!-\!f(a)\bmod (x\!-\!a)(x\!-\!b) &= (x\!-\!a)\left(\dfrac{f(\color{#C00}x)\!-\!f(a)}{x\!-\!a}\bmod \color{#C00}{x\!-\!b}\right)\\
&= (x\!-\!a)\left(\dfrac{f(\color{#C00}b)\!-\!f(a)}{b\!-\!a}\right)\ \ {\rm if}\ \ a\neq b\\
&= (x\!-\!a)\,\ f'(a)\qquad\qquad\ \ \, {\rm if}\ \ a = b
\end{align}$$
In OP: $\,a=1,b=-2,\,$ so above $\,\Rightarrow\,f(x)\!-\!3 \equiv (x\!-\!1)(42)\ $ so $\ \bbox[5px,border:1px solid #c00]{f(x) \equiv 42x-39}$
Note $ $ Above we used the Factor Theorem $\,x-a\mid f(x)-f(a),\,$ i.e. $\,f(x)\equiv f(a)\pmod{\!x-a}.\,$
The above method does not require solving a system of equations - as some other methods do.
Below is a simple example - which may help to clarify the essence of the matter.
$\,\ \underbrace{x\!+\!2\mid f}_{\large f(-2)\ =\ 0\ }\Rightarrow\, f\bmod x^2\!-\!4\,$ $=\, (x\!+\!2)\Bigg[\dfrac{f}{x\!+\!2}\bmod x\!-\!\color{#c00}2\Bigg]$ $ =\, \underbrace{(x\!+\!2)\left[\dfrac{f(\color{#c00}{2})}{\color{#c00}2\!+\!2}\right] =\, 2(x\!+\!2)}_{\large f\bmod x-\color{#c00}2\,\ =\,\ f(\color{#c00}{2})\,\,\ =\,\ 8}$
Alternatively, if modular arithmetic is unfamiliar we can eliminate it.
Write $\ f = f(a) + (x\!-\!a) g\,\ $ by dividing $\,f\,$ by $\,x\!-\!a.\,$ Dividing $\,g\,$ by $\,x\!-\!b\,$ yields
that $\,\ \ \ f = f(a) + (x\!-\!a)(g(a)+(x\!-\!b)h)$
So $
\ f(b) = f(a) \:\!+\:\! (b\!-\!a)\,g(a)\,$ by eval at $\,x=b.\,$ Solving for $\,\color{#c00}{g(a)}\,$ & substituting in above
$$ f(x)\, =\, \underbrace{f(a)\,+\,\color{#c00}{\dfrac{f(b)-f(a)}{b-a}} (x\!-\!a)}_{\large f(x)\,\bmod\, \color{#0a0}{(x-a)(x-b)}}\, +\, \color{#0a0}{(x\!-\!a)(x\!-\!b)} h(x)$$
The above Newton / Lagrange interpolant is precisely the Easy CRT solution of the system
$$\begin{align} f(x) \equiv f(a) &\pmod{x\!-\!a}\\ f(x)\equiv f(b)&\pmod{x\!-\!b}\end{align}\qquad$$
Generally Lagrange interpolation is a special case of CRT = Chinese Remainder Theorem. The first solution amounts to using the mod distributive law to derive Easy CRT as explained here.
Specializing $\,b = a\,$ yields first order Taylor series expansion. For polynomials this can be done purely algebraically (no limits) - see this purely algebraic definition of the derivative.
The $\!\bmod\!$ Distributive Law can be viewed as an equivalent "shifty" operational reformulation of CRT = Chinese Remainder Theorem, as I explain in the end of the Remark here. It is often more convenient to apply in calculations due to its operational form, e.g. here are many examples.