$f(x)\in \mathbb{R}[x]$ is a function that has a remainder of 2 when divided by $(x-1)$, and a remainder of 1 when divided by $(x-2)$.
I know that the remainder of $f(x)$ when divided by $(x-1)(x-2)=x^2-3x+2$ needs to be $-x+3$ but I just don't know how to prove it.
I tried to write down $$f(x)=q_1(x)\cdot (x-1)+2=q_2(x)\cdot (x-2)+1$$ for $q_1,q_2\in\mathbb{R}[x]$, but I couldn't find what need's to be $p(x)\in\mathbb{R}[x]$ so that $$f(x)=p(x)\cdot (x-1)(x-2)+(-x+3)$$