7. Let the function $f(x)=x^{3}+a x^{2}+b x+c$ (where $a, b, c$ are all non-zero integers).
If $f(a)=a^{3}, f(b)=b^{3}$, then the value of $c$ is ( )
A. -16
B. -4
C. 4
D. 16
Solution: D.
Let $g(x) = f(x) - x^3 = ax^2 + bx + c$, then from $f(a) = a^3, f(b) = b^3$, we get $g(a) = g(b) = 0$. Therefore, $a$ and $b$ are the two roots of the equation $g(x) = 0$, so $a + b = -\frac{b}{a}, ab = \frac{c}{a}$. Eliminating $b$, we get $c = -\frac{a^4}{a+1} = -(a^2 + 1)(a - 1) - \frac{1}{a+1}$.
Since $c$ is an integer, we have $a + 1 = \pm 1$, i.e., $a = 0$ (discard) or $a = -2$. Hence, $c = 16$.