We study the production of hadron pairs in proton-proton collisions, selecting pairs with large total transverse momentum with respect to the beam, and small relative transverse momentum, i.e., belonging to a single jet with large transverse momentum. We describe the process in terms of dihadron fragmentation functions. We consider the production of one pair in polarized collisions (with one transversely polarized proton) and the production of two pairs in unpolarized collisions. In the first case, we discuss how to observe the quark transversity distribution in connection with a specific class of dihadron fragmentation functions, named interference fragmentation functions. In the second case, we suggest how to determine the latter and also how to observe linearly polarized gluons.