It's time for this subject to be covered. In 5e D&D (2014), the GM/DM has authority over the rules, the setting, and the game. It's important to discuss this with your players to stop / prevent any misuse of the rules by rules-lawyers. I'll be referencing the 5e core rule books. Note that since DMG (Dungeon Master's Guide) is intended for the GM, any instance of "you" or "you're" in the DMG means the DM/GM. Rules as written (RAW), below are entries where your authority as GM comes from. In some cases, I add emphasis on certain words or provide my notes or interpretation.
Player's Handbook
-PHB page 5: "One player takes on the role of the DM, the game's lead storyteller and referee."
Note, the emphasis here on referee is mine. Reference page 4 of the DMG for the game's definition of referee.
-PBH page 6 How to Play "the DM listens to every player and decides how to resolve those actions."
-The GM's role is to decide how to resolve player actions.
-PHB page 6: "Your GM might set the campaign...on one (a world) that he or she created...Ultimately, the DM is the authority on the campaign and its setting, even if the setting is a published world."
A GM may create a low fantasy or middle fantasy, humancentric setting where the other fantasy races, class options, spells, etc., are not in a part of.
-PHB page 17: "Humans are the most common people in the worlds of D&D..."
This rule establishes race as a feature of the setting. The setting is under the purview of the GM.
-PHB page 17: "Not every intelligent race of the multiverse is appropriate for a player-controlled adventurer."
Races in the core rules are listed implying they are appropriate. The implication is that others are not.
-PHB page 45: "Twelve classes...are found in almost every D&D world..."
Here, classes are defined as features of the setting. The setting is under the purview of the DM, as supported by other rules presented in this list. Further, the use of the word almost meaning not all D&D settings feature these twelve classes. Therefore, class restrictions by the GM are acceptable by the rules.
-PHB page 165: "This chapter defines two optional sets of rules for customizing your character: Multiclassing and Feats...Your DM decides whether these optional rules are available in a campaign."
This rule is cited here for good measure. Also note that any instance of a variant rule may explicitly state in its description that the rule is available at the GM's option.
-PHB page 174: "The DM calls for an ability check when...an action has a chance of failure." And "For every ability check, the DM decides which of the six abilities is relevant to the task and the difficulty of the task."
Based on these rules, the players do not choose when to role dice and the players do not determine the difficulty.
-Note that this passage also says "when the outcome is uncertain, the dice determine the results. Note however that the DMG page 236 and 237 gives the GM authority over the dice.
-PHB page 185 Roleplaying: "Roleplaying is, literally, the act of playing out a role...you as a player determine who your character thinks, acts, and talks."
This provides the definition of roleplaying in 5e D&D. The act of playing a role. You the player play your character, you do not, for instance, rely on outside influence such as die rolls or input from other participants or observers at the game. Consider referencing this definition when discussing metagame thinking (metagaming), DMG page 235.
-PHB page 186 Results of Roleplaying: "The DM uses your character's action and attitudes to determine how an NPC reacts..." "Pay close attention to the DM's portrayal of the NPC's mood, dialogue, and personality. You might be able to determine an NPC's personality traits, ideals, flaws, and bonds, then play on them to influence the NPC's attitude." "Interactions in D&D are much like interactions in real life..."
-This portion of the rules gives the player instruction on how to treat NPCs and what to expect from the game and the GM. The game fully states that the player should treat NPCs and approach conversations like they would in real life, to pay attention, and to play on the DM's portrayal to affect the NPC's attitude, and that the DM uses the player's actions and attitude to determine how the NPC reacts. The game mechanics and dice rolling are not described as necessary here.
-PHB page 186 Ability Checks: "Your roleplaying efforts can alter an NPC's attitude, but there might still be an element of change... Your DM can call for a Charisma check at any point during an interaction if she or he wants the dice to play a role in determining an NPC's reactions."
- Rules as written, charisma checks are entirely at the discretion of the DM and not at the game or the rules or the player(s). "Your DM can call for a...check...if he wants the dice to play a role..." In other words, it's the DM's character and they don't have to let the dice influence their character.
-This rule, in combination with pages 4, 236, and 237 of the DMG, the PCs are not entitled to a speech roll. The GM can resolve social interactions with roleplaying only. The rule says "Your DM can..." not must, and "if he" in reference to the DM "wants the dice..." and not when the player wants the dice. Further, the charisma rules are called upon when there might be an element of chance. The real questions are why would there be an element of chance and who decides this, and how much does chance affect the outcome?
Dungeon Master's Guide
*Reiterated for good measure, since the DMG (Dungeon Master's Guide) is intended for the GM, any instance of "you" or "you're" in the DMG means the DM/GM. This is supported by the monster manual page 4 which describes the Monster Manual and the DMG as books for the DM - just so we're clear.
-DMG page 4: "And as a referee, the DM interprets the rules and decides when to abide by them and when to change them."
-See also DMG page 235 "The rules serve the GM, not vice versa."
-Interpret: Some players may argue that something is permitted by the rules by virtue of what the rule is not expressly written to forbid. For example, a player may argue that the fireball spell creates a boom or shockwave because their interpretation of "explosion of flame" in the spells' description, and they may justify this as "well the rules don't say fireball doesn't cause a boom." As the interpreter of the rules, the GM may, and for fairness's sake should, interpret the rules to permit only what they are expressly written to permit and that anything not expressly permitted is therefore forbidden by virtue of their omission. To simplify this, rules are written to describe what something does, not what something doesn't do. RAW, fireball does fire damage, not thunder damage. Further, thunder damage is described as "concussive" like a shockwave, fire is not. A GM may therefore fairly rule that the boom of a fireball is flavorful, not mechanical, unlike a spell like Shatter.-When to abide, when to change: When and by what criteria is up to the GM. Some GMs might err in favor of fun. This may occasionally seem selective or break immersion. I advise that GM's consider the internal logic of their setting, meaning what makes sense for the setting and tone of your game, which will ensure more rulings that are impartial and fair. This is beneficial for believability or verisimilitude. Per page 235 of the DMG, rules serve the GM, therefore the GM may change rules that do not serve them.
-DMG page 4: "...but the rules aren't in charge. You're the DM, and you are in charge of the game."
The DM is in charge of the game, therefore, the GM may permit or forbid metagaming, rules discussion, establish house rules, decide which supplemental books are permitted if any, etc. To be fair, this is the sort of thing you want to discuss with your players early on to establish expectations.
-DMG page 4, How to Use This Book: "The last part helps you to adjudicate the rules of the game and modify them to suit the style of your campaign."
-DMG page 4, "Part 1: Master of Worlds": "Even if you're using an established world such as the Forgotten Realms...The world is yours to change as you see fit and yours to modify as you explore the consequences of your players actions."
-DMG page 5: "As a referee, the DM acts as a mediator between the rules and the players. A player tells the DM what he or she wants to do, and the DM determines where it is successful or not..." and "the rules don't account for every possible situation...How you determine the outcome of this action is up to you."
These two rules give the GM liberty about how to resolve actions.
-DMG Page 9: "Your world is the setting for your campaign. Even if you use an existing setting...it becomes yours."
The GM has purview over their setting just as the players have agency over their characters.
-DMG page 9, section "It's your World": "The assumptions sketched out above (reference section Core Assumptions) are not carved in stone...You can build an interesting campaign setting by altering one or more of these core assumptions..."
Rules as written, the GM may define the assumptions about the world. For example, the GM may ground the world in realism. In other words, fantasy does not mean anything goes.Additionally, a GM may restrict classes, races, etc. Such things may exist in the setting, but they may not be adventuring classes, races, etc.
-DMG page 235: "The rules serve you, not vice versa."
In other words, rules are meant to serve the GM. Rules that do not serve the GM are subject to change by the GM per DMG page 4.
-DMG page 236: "Dice are neutral arbiters...The extent to which you use them is up to you."
-DMG page 236; Definitely read the section "The Role of the Dice" on page 236 of the DMG which describes using the dice a lot, using the dice a little / for combat only, and using the dice somewhere in the middle: "One approach is to use the dice as rarely as possible. Some DMs use them only during combat and determine success or failure as they like in other situations."
-Rules as written (RAW), the 5e DMG effectively makes ability checks optional.
-Also reference PHB page 186 Ability Checks which states that the DM can call for a Charisma Check if he wants the dice to play a role in the NPCs reactions meaning charisma checks are not compulsory in social interaction.
-DMG page 237: "Remember, the dice don't run your game, you do." and "At any time, you can decide that a player's action is automatically successful. You can also grant the player advantage on any ability check...By the same token, a bad plan or unfortunate circumstance can transform the easiest task into an impossibility, or at least impose disadvantage."
Here, the rules provides precedent for the GM ruling that actions are impossible.
DMG page 238: "It's your job to establish the Difficulty Class for an ability check or saving throw when a rule or adventure doesn't give you one. Sometimes you'll even want to change such DCs."
This rule says the GM determines the difficulty when the rules don't, and even when the rules do.
DMG page 239: "...In other cases, you decide whether a circumstance influences a roll...and you grant advantage or impose disadvantage..."
DMG page 239: Variant: Automatic Success. This variant rule allows the GM to call for an automatic success if the DC is less than or equal to the relevant ability score.
DMG page 241, "Ignoring Inspiration" is a section that says the GM may ignore this rule and not use inspiration in their game.
-DMG page 242, Resolution and Consequences: "You determine the consequences of attack rolls, ability checks, and saving throws..."
There are three subsections: Success at a Cost, Degrees of Failure, and Critical Success or Failure. In other words, the rules grant you the GM liberty to use these, and these are not labeled as optional, therefore they are core meaning one can assume the game intends the GM to take such liberties.
-Success at a Cost: "When a character fails a roll by 1 or 2, you can allow the character to succeed at the cost of a complication or hinderance."-Degrees of Failure: "Sometimes a failed ability check has different consequences depending on the degree of failure."-Critical Success of Failure: "Rolling a 20 or a 1 on an ability check or a saving throw doesn't normally have any special effect. However, you can choose to take such an exceptional roll into account..."
-DMG page 244 Social Interaction: "Some DMs prefer to run social interaction as a free-form roleplaying exercise, where dice rarely come into play..."
The rules as written grant a GM liberty to run social interactions with dice or without dice.
-DMG page 245. 3 Charisma Check: "...call for a Charisma check."
The DMG seemingly instructs the DM to call for a charisma check when this or that occurs; however, this contradicts the advice given elsewhere, such as 236, 237, and 242 of the DMG which support the GM using their judgement to adjudicate actions of the players and applying the rules of the game. Therefore, I take this as advice not instruction.
-DMG page 260 Absent Characters: "If a player is absent for a session, the player's character misses out on the experience points."
-DMG page 261 has rules for awarding experience for noncombat encounters, for milestones, or for advancing players based on other criteria such as sessions, completing goals, etc. None of these are identified as optional within the rules, and so 5e is intended to permit the GM to award XP for anything.
-DMG page 263 GM's Workshop: "As the GM, you aren't limited by the rules in the PHB, the guidelines in this book, or the selection of monsters in the Monster Manual."
-Another interpretation is that the GM can create their own content, and this chapter provides guidelines on how to do that. Further, the GM is permitted to change monsters.-One interpretation of this passage is that the players are limited to these three core rulebooks but the GM isn't, and so rules found in supplemental books as Sword Coast Adventurer's Guide, Xanathar's Guide to Everything, or Tasha's Cauldron of Everything are optional and at the discretion of the GM.
-DMG page 287 Restricting Class Access: "Without changing the way a class functions, you can root it more firmly in the world by associating the class with a particular race or culture."
In conjunction with previous rules about the setting being under the purview of the GM, the GM can essentially restrict classes from the game by tying them to races that aren't available in your setting.
-DMG page 235 Metagame Thinking: "Metagame thinking means thinking about the game as a game...Discourage metagame thinking by giving the players a gentle reminder 'what do your characters think?'"
-Roleplaying is defined in 5e in the PHB, page 185 (for reference). The player determines how your character thinks, acts, and talks. The 5e rules instruct the DM to discourage Metagame thinking, and so it's reasonable to conclude that it's poor roleplaying to allow knowledge of the game rules which the character does not possess to determine how your character thinks.
-Per page 4 of the DMG, the DM is in charge of the game. You the GM cannot prevent metagaming because you cannot control how the players think, but there are no rules that state the GM must facilitate metagaming. In fact, per page 235, Rules Discussion, you the GM might need to set a policy on rules discussion at the table. Your rules discussion policy may be no rules discussion at the table, and so you are not obliged put the game on hold to discuss the rules or GM rulings. To that end, if the player has questions like "if I do this, will the rules let me do that?", you do not have to answer the player's metagame thinking question about how the rules work or how you will make a ruling. Instead, give the player that prescribed gentle reminder as above.
-DMG page 4 "As a storyteller, the DM helps the other players visualize what's happening around them." You describe the scene, not how the game rules will work in a given scenario.
-DMG page 235 Table Talk "Decide how you feel about a player sharing information that his or her character wouldn't know or that the character is incapable of sharing..." Is the game a game, a roleplay exercise, or both? Is it more one or the other? Do you think it violates the spirit of a game if players communicate out-of-character knowledge?
-I cannot find any rules that explicitly permit the GM to award (bonus) XP for good roleplaying, or to penalize XP for bad roleplaying or metagaming,
Monster Manual
-MM page 4: "The Monster Manual, like the Dungeon Master's Guide, is a book for the DMs."
Therefore, any instance of "you" in this book is addressing the DM, not players. Further, the GM having control of the game per the DMG page 4, may also instruct the players that they should stay out of this book and forget everything they know about it.
-MM page 6 Modifying Creatures sidebar: "Feel free to tweak an existing creature..."
DMs are not limited to monsters as written or vanilla monsters. No restrictions are given.
-MM page 7 Alignment: "The alignment specified in a monster's stat block is the default. Feel free to depart from it and change a monster's alignment to suite the needs of your campaign."
Rules as written, a GM may decide that all goblins, orcs, etc., are evil in their setting.