1. He said, "Where do you live?"

2. He asked where I lived.
3. He asked where we lived.
4. He asked where he lived.
4. He asked where she lived.
5. He asked where they lived.
-----------------------------
Does #1 usually mean #2? What about the others? In Sentence 1, we can put the following after "he said." He said (to me, to us, to him, to her, to them) So according to the context, we can think of several sentences? Am I right?

Yes, 1 and 2 mean about the same.

3-5 mean that the original sentence was stated differently, such as ...

He asked us, "Where do you live?"
He asked him, "Where do you live?"
He asked her, "Where do you live?"
He asked them, "Where do you live?"

Yes, you are correct. In Sentence 1, "He said, 'Where do you live?'" the speaker is directly addressing the person they are speaking to. In this case, if the person being addressed is "you," then Sentence 1 would mean the same as Sentence 2, "He asked where I lived." Here, the word "you" in Sentence 1 refers to the person being addressed directly, and "I" in Sentence 2 refers to the person speaking about themselves.

Similarly, for the other sentences:
- Sentence 3, "He asked where we lived," means that the speaker is addressing a group of people and is asking where that group lives.
- Sentence 4, "He asked where he lived," means that the speaker is referring to someone else entirely and is asking where that person lives.
- Sentence 4, "He asked where she lived," indicates that the speaker is asking about a specific female person's place of residence.
- Sentence 5, "He asked where they lived," implies that the speaker is talking about multiple individuals and is asking where they all live.

So, depending on the context and the person being addressed or referred to, the meaning of the sentences can vary.