When we ask what a role-playing game is, perhaps we should first ask what role-playing is. Role-playing is usually a blend of three related but distinct ideas:
1) I am the player-character. What would I do in a novel situation as presented by the narrative and setting of the game? This is largely an exploration of one's own ego. Novice role-playing gamers often take an approach to play rooted in this principle of naive escapism.
2) The player-character and I are kindred spirits. If I were this player-character, with his talents and faults, what would I do in circumstances specified by the setting, characters, and narrative of the game environment? This is largely an exercise of the player's acting skills. The player's ego is deprecated in favor of the character's ego, but the player's ego is still a significant input in the emergent narrative.
3) The player-character exists independently of me as player. This is the most rarefied form of role-playing, and is a learned skill that role-players usually only develop with sustained experience. The player specifies some initial inputs of the player-character's characterization to assure his own engagement with the overall endeavor, but beyond that the ego of the player is entirely subsumed in the ego of the player-character. The player largely derives intellectual satisfaction from correctly deducing the best emergent narrative and fullest characterization for a given player-character with which the player-character (rather than the player) will be satisfied, and perhaps also from empathy or sympathy with that narrative and characterization of the player-character.
A role-playing game, then, is a game that faciliates a player having one or more of the aforementioned experiences. The value of a role-playing game is in direct proportion to how well it accomplishes this goal. Adventure games present a good model of player engagement compatible with role-playing, so many role-playing games incorporate aspects of the adventure game experience; however, I'm glad to see a number of others have correctly noted that we should not confuse mechanics of gameplay (perhaps, rooted in adventure game design principles) with the purpose of gameplay itself-- to derive pleasure from acting out some sort of role. Though the player must likely master numerous mechanics of gameplay in order to accomplish the latter, what distinguishes role-playing games from other sorts of games is that the gameplay process of most games consists only of mastering such mechanics, while in role-playing games such mastery is merely a means to an entirely different end. Players attempt to win other sorts of games, while in role-playing games players instead seek to have a particular sort of experience while playing. A winning play in a role-playing game consists of whether a satisfactory subjective experience was enjoyed during play rather than whether any objective criteria were satisfied (such as whether a score was obtained or a result achieved that, per the mechanics of gameplay, qualifies as 'victory').
In (1) the player-character acts like the player. In (2) the player acts like the player-character. In (3), there is only the player-character, because the player and player-character become indistinguishable; translation of the player-character's experience satisfies the player empathetically, and the player seeks to minimize any distortion of such translation resulting from the introduction of extraneous elements (namely, himself). (3) exercises imagination above all, because the player must imagine numerous aspects of a foreign ego to give that foreign ego a satisfactory life of its own. Imagining matters far removed from our own experience is much more difficult than imagining matters similar to our own experience. Another way to say this may be that much more imagination is required to divine the similarities between widely divergent experiences than is required to notice the commonalities of similar experiences.
Because (3) play is more difficult both for designer to facilitate and for player to pursue, (3) play is the least common type of rpg play. However, this does not necessarily make it the most inherently satisfying type of rpg play; that is a matter for each player to decide for himself. We might be tempted to say that those who enjoy (3) play enjoy a more profound experience than those who enjoy (1) play, but the rarity of (3) play opportunities typically means the individual satisfied by (1) play has so many more occasions to satisfy himself (because (1) games are easier to make well) that perhaps overall that multitude of (1) experiences counterbalances the density of (3) experiences.