Wireless small cell networks and device-to-device (D2D) communications are seen as two major features of next-generation wireless networks. In this paper, a novel approach for enabling D2D communication underlaid on a wireless small cell network is proposed. Unlike existing works which focus on network performance analysis given a chosen communication mode, in this paper, the strategic selection of a desired wireless communication mode between pairs of users is studied. On the one hand, communication using the small cells can provide reliable transmission but is limited by interference and backhaul constraints. On the other hand, D2D communication can provide high capacity due to devices' proximity but is limited by increased interference. To capture these properties, the problem is modeled as a noncooperative game in which pairs of communicating users can strategically decide on whether to communicate with one another via the small cell infrastructure or via direct D2D communication. In this proposed game, each device selects its preferred communication mode while optimizing a utility function that captures the various involved tradeoffs between communication performance and associated costs. For solving this game, a distributed best response-based approach is proposed using which the users can reach a Nash equilibrium. Simulation results show that the resulting network at the equilibrium is composed of a mixture of D2D and small cell communication links. The results also show that the proposed approach yields a significant improvement in terms of the average utility per communicating pair when compared with the cases in which the users communicate via only the small cells or via only D2D.