5. The function $f(x)=x^{2}-2 a x+a$ has a minimum value on the interval $(-\infty, 1)$. Then the function $g(x)=\frac{f(x)}{x}$ on the interval $(1,+\infty)$ must $(\quad)$.
(A) have a minimum value
(B) have a maximum value
(C) be a decreasing function
(D) be an increasing function
5.D.

Given that $f(x)=x^{2}-2 a x+a$ has a minimum value in the interval $(-\infty, 1)$, we get $a<1$.
Thus, $g(x)=\frac{f(x)}{x}=x+\frac{a}{x}-2 a$.
When $a \leqslant 0$, $g(x)=x+\frac{a}{x}-2 a$ is definitely an increasing function on $(1, +\infty)$;

When $0<a<1$, $g(x)$ is decreasing on $(0, \sqrt{a})$ and increasing on $(\sqrt{a},+\infty)$, and $(1,+\infty) \subset(\sqrt{a},+\infty)$. Therefore, $g(x)$ is an increasing function on $(1,+\infty)$.