The rules for grappling require:
The target of your grapple must be no more than one size larger than
you, and it must be within your reach. (PHB, p. 195, italics added)
Normally, this would mean that you must be within 5' of a creature to grapple it. But some creatures have a longer reach. For example, an Ancient Red Dragon could grapple a creature with its claws which is 10' away from it (an odd use of its action, but whatever).
Jeremy Crawford has already indicated that if you're grappled, you can still attack the creature grappling you even if their space is outside your reach, since you can attack the arm/tentacle/appendage that is holding onto your body. But I wondered about a similar situation: ranged attacks.
The rule on making ranged attacks while an enemy is nearby states:
When you make a ranged attack with a weapon, a spell, or some other
means, you have disadvantage on the attack roll if you are within 5
feet of a hostile creature who can see you and who isn’t
incapacitated. (PHB, p. 195, italics added)
So if you are grappled by a creature who is 10' or more away from you (but you're in its reach), and you make a ranged attack, do you have disadvantage?
On the one hand, you are more that 5' away from its space. On the other hand, part of its body is definitely within 5' of you, since you're grappled by it.
Is there any definitive answer to this question? I've tried to search similar questions and sage advice, but without success.
Best Answer
RAW, grappling with reach doesn't impose disadvantage
There are no rules stating that being within a monster's reach imposes disadvantage. The rules explicitly say "within 5 feet", not "within an enemy's reach". Grappling, unless otherwise stated, does not naturally impose disadvantage to attacks by itself.
Grappling does say this:
So if you are not within 5 feet, and grappling does not impose disadvantage, and grappling relies on reach rather than adjacency, then being grappled at that extended reach will have no effect to your ranged attacks.
This does bring up a possible question as to how movement/positioning works after being grappled with reach, but that may be grounds for a different question.