Find the number of values between i & j(given as input) in an unsorted array in O(1) time
In $A$, $rank( A[i] ) = \left\vert\left\{ j \in A : -\infty &lt; j &lt; A[i] \right\}\right\vert $

So you could sort the array by putting each element at its rank (up to duplicates, which can also be counted with 2 range queries), so if you could answer queries like this in $O(1)$ time and $O(n)$ preprocessing time and space, you would have an $O(n)$ sorting algorithm.

The latter does exist of course, but only under certain constraints, eg on the range of values.