I am a masters student. This semester I had a course with my supervisor. This course was not directly related to my thesis. During the term, the professor assigned me an in-class project (which was his previous work). I became interested in this course and project. How can I ask him to assign me to write a paper? Having said that, I am funded by one of his projects and this is another one. Is it appropriate to ask him to assign me tasks to publish the paper related to this course? If yes could you please tell me how should I write my letter?
If you have a vision for a paper, you could (1) talk to him about it and show him your proposed outline, or (2) just start drafting it if you're really motivated to do it, as @Buffy pointed out, there's nothing stopping you from doing it.
Direct communication and/or initiative goes a long way.
I don't understand whether you want an additional assignment or a replacement assignment. In the first case, there is no need for the assignment if you have your own ideas. You can just write the paper without any permission needed. You an even publish it without permission.
However, if you do need to discuss this (either case) with your professor, the best way, by far, is to do it in person, not by mail. Only if a face-to-face meeting is truly impossible would I resort to mail. But one way to proceed is to include with your request (in either case) would be to include an outline, at least, of your ideas for the new work. Include this in addition for the reasons why you want to take on the new work. Show both interest in the topic and the fact that you have also spent time and thought on it.