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.

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$.
