Translation:My son writes texts for the Prime Minister.
The same way. This sentence is ambiguous. If you wanted to disambiguate, you could say עבור ראש הממשלה, making it definitely "for". But I can't think how you would make it definitely "to".
Unless you add וראש הממשלה קורא אותם ונהנה מהם OR וראש הממשלה עסוק מדי לקרוא אותם OR something else... you get the idea
In the last 10-20 years, "texts" can be used to mean text messages, and is SMS, iMessage, or other apps. However, this meaning of "text" is not common in Hebrew.
Yes, it can mean the text of speeches or memos, but you would usually say that. It is a strange sentence.