Prove that $\forall n\in\mathbb{Z}^+$, a sequence with $n^3$ elements either has $n$ equal elements or a monotone subsequence with $n$ elements (strictly increasing or strictly decreasing).
I tried to apply the pigeonhole principle but had no idea how to go on. Anyone can give me a hint?