DFA Infiniteness Testing
The upper bound comes also from the proof of the pumping lemma. If you have a DFA with $n$ states, you know that if it accepts a word in length $\ge n$ then the word passes through a circle in the states, thus you can repeat the circle as many times as you like and get an infinite language.

Now, for the upper bound, assume the DFA is infinite, and accepts a word of length $\ge2n$. Now, when you run the word on the DFA, and since the DFA has only $n$ states, there must be a cycle. That cycle must be of length $\le n$. You can now remove a number iterations from that circle such that you will get a word $w$ of length $n\le |w| &lt; 2n$.

The proof is even easier when you use the pumping length $n$ derived from the pumping lemma. Just show that for a word $w=xyz$ where $|w|\ge 2n$, since $|xy|\le n$ and $|y|&gt;0$ there exists an $i\in \mathbb{N}$ such that $n\le |xy^iz| &lt; 2n$.