Find polynomial $f(x)$ based on divisibility properties of $f(x)+1$ and $f(x) - 1$ $f(x)$ is a fifth degree polynomial. It is given that $f(x)+1$ is divisible by $(x-1)^3$ and $f(x)-1$ is divisible by $(x+1)^3$. Find $f(x)$.

Another ad hoc solution is the following:
$$
32 = \Big((x+1)-(x-1)\Big)^5 \\
= (x+1)^5 -5(x+1)^4(x-1) +10(x+1)^3(x-1)^2 \qquad \\ \qquad -10(x+1)^2(x-1)^3 +5(x+1)(x-1)^4
-(x-1)^5 \\
= (x+1)^3\Big((x+1)^2-5(x+1)(x-1)+10(x-1)^2\Big) \qquad \\ \qquad 
-(x-1)^3\Big(10(x+1)^2-5(x+1)(x-1)+(x-1)^2\Big)
$$
so
$$
f(x) =
-\frac1{16} (x+1)^3\Big((x+1)^2-5(x+1)(x-1)+10(x-1)^2\Big) +1 =
-\frac1{16} (x-1)^3\Big(10(x+1)^2-5(x+1)(x-1)+(x-1)^2\Big) -1
$$
is $a$ solution.

For solving the general problem, we can repeat the usual proof of the Chinese Remainder Theorem. To solve the system
$$
f(x) \equiv r_1(x) \pmod{m_1(x)} \\
f(x) \equiv r_2(x) \pmod{m_2(x)}
$$
where $m_1$ and $m_2$ are co-prime, using Euclid's algorithm we construct some polynomials $p(x)$ and $q(x)$ such that 
$$ p(x)\cdot m_1(x) + q(x)\cdot m_2(x) = 1. $$
Then the solution will be
$$
f = (q \cdot m_2 \cdot r_1 + p \cdot m_1 \cdot r_2) \mod m_1m_2.
$$
