Solution (source code)

= Solution

For a <line bundle> $M$ on $C\times T$, put $d(t)=\deg M_t$, and choose an <ample line bundle> $A$ on $C$. Fix $t_0$. For sufficiently large $q$, both $H^1(C,M_{t_0}\otimes A^q)$ and $H^1(C,M_{t_0}^{-1}\otimes A^q)$ vanish, by <Serre duality> and negativity of the degrees of their dual canonical twists. The <semicontinuity theorem for coherent cohomology> makes both groups vanish on a neighborhood of $t_0$. The family is flat over $T$: $C\times T\to T$ is flat and the sheaves in question are locally free.

On that neighborhood the <Riemann-Roch theorem> gives
$$
h^0(C,M_t\otimes A^q)=d(t)+q\deg A+1-g,\qquad h^0(C,M_t^{-1}\otimes A^q)=-d(t)+q\deg A+1-g.
$$
Upper semicontinuity of both zeroth <sheaf cohomology> dimensions, after shrinking again, gives $d(t)\leq d(t_0)$ and $-d(t)\leq-d(t_0)$. Hence $d(t)=d(t_0)$. \b[The degree is locally constant, and thus constant on connected $T$.] With the usual convention that a variety is irreducible, this proves the assertion as printed. If disconnected varieties are allowed, the necessary qualification is constancy on each connected component: take $T$ to be two points and the bundles $\mathcal O_{\mathbb P^1}$ and $\mathcal O_{\mathbb P^1}(1)$ to see that a global constant degree need not exist.