Solution (source code)

= Solution

Let a deterministic automaton for $L$ have $p$ states. During the first $p$ input symbols of an accepted word $w$ of length at least $p$, the run visits $p+1$ states, so two coincide. Write $w=xyz$ so that $y$ labels the nonempty loop between those visits and $|xy|\leq p$. Traversing that loop any number of times leaves the remainder of the accepting run unchanged, giving $xy^iz\in L$ for every $i\geq0$.