1. He read a book to me.

2. He read a book for me.

3. He wrote a letter to me.
4. He wrote a letter for me.

5. He sang a song to me.
6. He sang a song for me.

7. He passed a book to me.
8. He passed a book for me.

9. He gave a pen to me.
10. He gave a pen for me.

11. He played a record to me.
12. he played a record for me.
-----------------------------------------
Can we use both 'to' and 'for' in the sentences? Which ones are ungrammatical? Do you have any rules regarding that?

I see nothing wrong about these. The meaning changes of course.

Damon is right. The words "to" and "for" are not interchangeable in these sentences if you want to keep the meaning the same.

In the given sentences, both "to" and "for" can be used. Let's go through each sentence to understand the meaning and usage of "to" and "for":

1. He read a book to me.
This sentence implies that he read the book aloud, with the intention of sharing the content or story with you.

2. He read a book for me.
This sentence suggests that he read the book on your behalf or as a favor to you.

3. He wrote a letter to me.
Here, the letter is addressed and intended specifically for you.

4. He wrote a letter for me.
This implies that the letter was written on your behalf or as a favor to you.

5. He sang a song to me.
This means he sang the song with the intention of performing or sharing it directly with you.

6. He sang a song for me.
In this case, he may have sung the song on your behalf, dedicating it to you, or as a favor to you.

7. He passed a book to me.
This indicates that he physically handed you the book.

8. He passed a book for me.
This sentence doesn't sound grammatically correct. It's more appropriate to use "to" in this context.

9. He gave a pen to me.
This means he physically handed you the pen.

10. He gave a pen for me.
This sentence doesn't sound grammatically correct. It's more appropriate to use "to" in this context.

11. He played a record to me.
This implies that he played the record with the intention of you listening or enjoying it.

12. He played a record for me.
This sentence suggests that he played the record on your behalf, dedicating it to you, or as a favor to you.

Regarding the rules for using "to" versus "for," it generally depends on the context and the meaning associated with each preposition. "To" is typically used when the action is directed towards someone or has the purpose of reaching someone, while "for" is used when the action is done on behalf of someone or as a favor.