If the answer for the first paragraph is to be a collection of intervals, then look at the range tree and interval tree data structures and ignore the rest of what I have to say.
If the answer for the first paragraph is a simple count, then range tree and interval tree are not what you want, because the cost for a search there grows with the number of intersecting intervals found. However note that if i < j and interval i intersects with interval j then interval j intersects with interval i, so that if you were checking for intervals i, j such that i > j then you would still see a match. This means that the answer you get does not depend on the order in which you present the intervals so you can choose that to suit yourself.
Sort the intervals into order of increasing first co-ordinate and work through them one by one, keeping a queue of intervals seen so far ordered by decreasing second co-ordinate. When you see a new interval, remove from the queue all intervals previously seen that have a second co-ordinate that means it does not intersect with the new interval. The new interval will intersect with everything else, so accumulate the number of intersections found, add the new interval to the queue, and continue.
This gives you a count of the number of intersections in time n log n. If you want the number of non-intersections, subtract this from n(n-1)/2.