Finding polynomial $p(x)$ when it leaves remainders $1$ and $2$ when divided by $x^{100}$ and $(x-2)^3$. 
Find a polynomial $p(x)$ that simultaneously satisfies the following properties:
(i) When $p(x)$ is divided by $x^{100}$ the remainder is the constant polynomial $1$.
(ii) When $p(x)$ is divided by $(x − 2)^3$ the remainder is the constant polynomial $2$.

We can write $p(x)=x^{100}g(x)+1=(x-2)^3h(x)+2$ for some polynomial $g$ and $h$.
Then, $p'(x)=x^{99}\left(xg'(x)+100g(x)\right)=(x-2)^2\left((x-2)h'(x)+3h(x)\right)$,
whence $p'$ is divisible by $x^{99}$ and $(x-2)^2$. So $p'$ is also divisible by $x^{99}(x-2)^2$.
Let $p'(x)=x^{99}(x-2)^2f(x)$ for some polynomial $f$.
Then, $p(x)=f(x)\displaystyle\int x^{99}(x-2)^2\,dx=f(x)\left(\frac{x^{102}}{102}-\frac{4x^{101}}{101}+\frac{4x^{100}}{100}\right)+c$
Now, $p(0)=1\Rightarrow c=1$ and $p(2)=2\Rightarrow f(2)\left(\dfrac{2^{102}}{102}-\dfrac{4\times2^{101}}{101}+\dfrac{4\times2^{100}}{100}\right)+1=2,$
from which I get $f(2)$ and hence $f(x)$ (since I assumed $f$ is constant). Therefore I find $p(x)$.

But is there a justification of treating $f$ as a constant or was it a mistake on my part?
I would particularly like to know what are all different ways to solve problems like this? I know it can be solved using the Chinese remainder theorem. Would that be the simplest way to proceed?

EDIT. This is a similar question where the remainders are non-constant polynomials.
 A: As a compulsory ad hoc trick let me first proffer:
We know that $(x-2)\mid (x^{100}-2^{100})$, so $(x-2)^3$ is a factor of
$$q(x):=(x^{100}-2^{100})^3=x^{300}-3\cdot2^{100}x^{200}+3\cdot2^{200}x^{100}-2^{300}.$$
Therefore $q(x)\cdot2^{-300}$ has remainder $-1$ when divided by $x^{100}$ and
remainder $0$ when divided by $(x-2)^3$. This means that
$$
p(x)=2+\frac{q(x)}{2^{300}}
$$
will work.

OTOH if you want to find the lowest degree polynomial $p(x)$ then
I would bail out with solving for the unknown coefficients of $p(x)=1+a_0x^{100}+a_1x^{101}+a_2x^{102}$ from the constraints
$p(2)=2, p'(2)=p''(2)=0$. There are three constraints coming from the remainder modulo $(x-2)^3$, so we need three unknown coefficients in $p(x)$
A: In general, the Chinese Remainder Theorem is a certain way to go.  Other tricks usually have limitations.
Let $K$ be a field of characteristic $0$ (this answer is probably good in other characteristics, but I am not going to think about them).  In your particular case, you have two polynomials of the form $$P(x)=(x-a)^m\text{ and }Q(x)=(x-b)^n$$ for some integers $m,n>0$ and $a,b\in K$ with $a\neq b$ (as an exercise, you should try to see why your trick does not work when there are more than two such divisor polynomials).  You know that the general form of a polynomial $f(x)$ which gives the remainder $r\in K$ when divided by $P(x)$ and which gives the remainder $s\in K$ when divided by $Q(x)$ must take the form
$$f(x)=M(x)\,u(x)+v(x)\,,$$
where $M(x):=P(x)\, Q(x)$, and $u(x)$ and $v(x)$ are polynomials in $K[x]$ with $$\deg\big(v(x)\big)\leq m+n-1\,.$$
Now, it is easily seen that the degree of $v'(x)$ is at most $m+n-2$.  As $v'(x)$ must be divisible by $(x-a)^{m-1}$ and $(x-b)^{n-1}$, it is divisible by $(x-a)^{m-1}\,(x-b)^{n-1}$.  This means
$$v'(x)=c\,(x-a)^{m-1}\,(x-b)^{n-1}$$
for some constant $c\in K$.  This is a justification for your attempt, and most likely will not work in general, for example, when $r$ and $s$ are replaced by nonconstant polynomials $R(x)$ and $S(x)$.
