If A+tB is nilpotent for n+1 distinct values of t, then A and B are nilpotent. 
Suppose $A$ and $B$ are $n\times n$ matrices over $\mathbb{R}$ such that for $n+1$ distinct $t \in \mathbb{R}$, the matrix $A+tB$ is nilpotent. Prove that $A$ and $B$ are nilpotent.  

What I've tried so far:
 Define $f(t)=(A+tB)^n$. Then $f(t)$ has polynomials of degree at most n as its entries. Each of these polynomials has n+1 distinct roots, and hence is the constant zero polynomial. This shows that for all $t \in \mathbb{R} \ f(t)=0$, which in particular gives $A^n= f(0) =0$ that shows A is nilpotent.
Now if none of the $t_1,...t_{n+1}$ , that make A+tB nilpotent, is zero, we can use $g(t)=(tA+B)^n$ with roots $\frac{1}{t_i}$ similarly and show that B, too, is nilpotent. But I have no idea in case one of the $t_i$ is zero.
Thanks in advance.
 A: One can do it this way.
Consider the polynomial in the two variables $t, \lambda$
$$
(-1)^{n} \det((A + t B) - \lambda I).
$$
Consider this as a polynomial in $t$, of degree $n$, with coefficients in the field of rational functions $\mathbb{R}(\lambda)$. By hypothesis, for $n+1$ distinct values of $t$, it coincides with  $\lambda^{n}$, so that one has the equality
$$
(-1)^{n} \det((A + t B) - \lambda I) = \lambda^{n}
$$
of polynomials in $t, \lambda$. So we can substitute anything in $t$ or $\lambda$, and it will still be an equality. Substitute $t^{-1} \mu$, where $\mu$ is another indeterminate, for $\lambda$, and $t^{-1}$ for $t$ so that we have
$$
(-1)^{n} \det((A + t^{-1} B) - t^{-1} \mu I) = (t^{-1} \mu)^{n}.
$$ 
 Considering this equality in the field of rational functions, we can multiply by $t^{n}$ and obtain
$$
(-1)^{n} \det((t A + B) - \mu I) = \mu^{n}.
$$
This is now an identity of polynomials in the indeterminates $t, \mu$. 
Finally set $t = 0$ to get that the characteristic polynomial of $B$ is $\mu^{n}$, up to the sign, so that $B$ is also nilpotent.

Note that the basic trick is a common one, and appears for instance in applying Eisenstein's criterion to prove that the $p$-th cyclotomic polynomial has degree $p-1$, when $p$ is prime. That is, one has a prime $p$, and wants to prove that if $x = 1 + t$, then
$$\tag{equality}
x^{p-1} + x^{p-2} + \dots + x + 1 =\\=
t^{p-1} + \binom{p}{p-1} t^{p-2} + \dots + \binom{p}{2} t + \binom{p}{1}.
$$
One argues that
$$
x^{p} - 1 = (x-1) (x^{p-1} + x^{p-2} + \dots + x + 1),
$$
and then substituting $x = 1 + t$ one has
\begin{align}
x^{p} - 1
&=
(1+t)^{p} - 1 
\\&= \left( \sum_{i=0}^{p} \binom{p}{i} t^{i} \right) - 1
\\&=
t \cdot \sum_{i=1}^{p} \binom{p}{i} t^{i-1}
\\&=
t \cdot (t^{p-1} + \binom{p}{p-1} t^{p-2} + \dots + \binom{p}{2} t + \binom{p}{1}).
\end{align}
Now you can divide by $t = x - 1$ and get the required (equality), which is an equality of polynomials, and thus still holds when $t = 0$ (and thus $x = 1$), despite the fact that we have divided by $t$.
A: This is a a more complete write up using the ideas of @QuangHoang.  It can also be viewed as an analytic (instead of algebraic) version of the ideas of @AndreasCaranti
As before, define $f(t)=(A+tB)^n$.  This is a matrix valued function, but by examining the individual entries we have $n^2$ real valued functions.  We have that $f(t)_{ij}$ is a polynomial of degree at most $n$ which has at least $n+1$ roots, and is therefore identically zero, so $(A+tB)^n=0$ for all $t$.  When $t=0$ we have the result that $A$ is nilpotent.
Now, consider $g(t)=((1-t)A+tB)^n=(1-t)^nf(t/(1-t)).$  When $t\neq 1$, we have from the above that $g(t)=0$.  However, $g(t)$ is also a polynomial in $t$ in each entry, and hence it is continuous, so $g(1)=B^n=0$.
A: Once $f(t)=0$ for all $t$, you can forget the original $n+1$ values of $t$ and pick any $n+1$ non-zero values then proceed with your argument.
A: I propose a slightly different algebraic proof, in which instead of matrix polynomials we just use the coefficients of the characteristic polynomial:
A matrix $M\in$Mat$_n(K)$ is nilpotent if and only if its characteristic polynomial is $p_M(X)=X^n$, if and only if the coefficients $c_j$ of $p_M(X)=c_0X^n+\ldots+c_n$ are zero except for the first one. The coefficient $c_j$ is the sum of the principal minors of $M$ of order $j$.
Consider the matrices $C(t):=A+tB$. By construction $c_j(C(t))$ is a polynomial of degree $j$ in $t$ (e.g. $\det(C(t))$ has degree $n$), and since $C(a_i)$ is nilpotent, we know that $c_j(C(a_i))=0$ for $a_1,\ldots,a_{n+1}$; as $\deg(c_j(C(t)))\leq n$, this implies that $c_j(C(t))=0$ as a polynomial for all $j=1,\ldots,n$. In particular, $c_j(A)=c_j(C(0))=0$ for all $j=1,\ldots,n$, so $p_A(X)=X^n$, i.e., $A$ is nilpotent.
Now, if $M$ is nilpotent then $\lambda M$ is nilpotent for any $\lambda\in K$, so if $a_i\neq0$ then $A+a_iB$ nilpotent implies $a_i^{-1}A+B$ nilpotent and we can repeat our previous argument reversing the roles of $A$ and $B$ to find that $B$ is nilpotent. If for some $k$ we have $a_k=0$, then since $c_j(C(t))=0$ as a polynomial, we can just pick a new value $a_k'\neq0$ and different from the other $a_i$.
