This can be done in O(1) time
Assume all the numbers are distinct. Check the first 3 numbers. Let them be $a_i$, $a_j$ and $a_k$. If they are increasing or decreasing, then we are done.
- $a_j$ is lesser than or greater than $a_i$,
- $a_k$ lies between $a_i$ and $a_j$.
Now take the 4th term $a_l$. Whereever $a_l$ lies relative to $a_i$, $a_j$ and $a_k$, the condition will be satisfied.
Now assuming the numbers are not distinct, check the first 6 terms. If the condition is not satisfied, then there has to be 3 distinct terms repeated twice reach. If there are 4 or more distinct terms then Argument 1 works.
Now check the 7th term. If the 7th terms matches any of the 3 distinct terms prior to it, then 3 terms are equal between the indices [1..6] or [0..5] (whatever your numbering convention). This satisfies the condition. If the 7th term is not present in the previous indices, then we have 4 distinct terms from [1..7] or [0..6]. Apply argument 1 on these 4 terms.