There's at least two kinds of easily confusable questions here:
- I hear the DMG has rules for X. I don't have the DMG. What are the rules for X?
- Are there rules for X? What are they?
#1 is a deeply problematic question that asks us to engage in violating copyright: the person should buy the book. We should not provide the materials.
#2 has no such implications and is actually a question about a real practical problem and probably acceptable! It is an uncommon kind of question for us, and it is not to be confused with #1.
In the example question (Are there alternative ways to gain XP?) I suspect the author is not even aware that such rules exist, or are to be found in the DMG. Some degree of system expertise doesn't mean they'll necessarily know this stuff, but just makes it more likely. In comments they say they're from Japan, and the Japanese don't have nearly as much exposure to or knowledge of Western RPG stuff as we do. They may not be aware that the PHB, DMG and MM make up some vital trifecta for D&D that covers all the basics.
A response of "just read the DMG, why are you asking us to reproduce it?" is appropriate for case #1, but for case #2 it is outright unhelpful and probably rude. We've basically answered their question (yes they exist, they're in the DMG) but in a way that really easily comes off as snarky and assumes ill intent and laziness where it does not exist.
In case #2, we can answer the question by saying: "yes, and here's where you can find them, though you'll have to buy the book because we can't reproduce them in full here without violating copyright." We can point them to the pages and give them a basic idea of what's involved, we can quote portions of those rules for analysis or commentary within the bounds of fair use, but providing a quote-dump of the rules in full, or instructing them on the rules in such detail they'll never have to pick up the original book, would violate copyright and is something we shouldn't do. (Unless the game and its rules are free or whatever, in which case go ahead.)
(In addition to just these two cases, there's other cousins of these questions like what KRyan's answer points out, but some of these are much more clearly acceptable.)
Telling the difference:
As Oblivious Sage points out in comments, RPG books can often not be as well organised as they could or should be. They can also be poorly written! Assume the asker is coming from ignorance, not malice.
So from that, the difference is: can you answer the question without reproducing the rules? If the answer's no, it's case #1 and the question is a problem — don't answer it. If yes, it's case #2 or some other variety — answer the question, explain where the rules can be found, summarise or name them if it helps, and do not reproduce the rules (except within fair use).