From a theoretical point of view, it will take $O(n \log n)$ time in the worst case. It can be done by sorting the array and then sequentially searching for any adjacent elements that are equal.
Note: The problem doesn't mention any bound on the elements of the array. The elements can be as large as wanted, and need not be integers! Assuming that the elements are bounded (as in Saurav's answer) or that the elements hash to unique locations (as in Sonu's answer) completely changes the problem.
Practically, you will always have a bound on the elements. If the bound is sufficiently small ($<32$ bits, for example), Saurav's answer will be efficient (if the $n\gg2^{32}$). Or you could have a hash function that provides unique hashes for all practical purposes. Then Sonu's answer would be the better way to go.