@jcancellier
Hey and welcome to the community forums!
It is used here as the question particle. Notice that it is followed by the の which is attached to the noun, therefore it modifies/describes/explains the noun 文章.
何になりたいかの文章を書き終わったら、絵を描いてください。
When you finish writing an essay about “what do you want to be?”, draw a picture.
You can think of the 何になりたいか as a noun phrase. That’s why it is possible to attach it to 文章 with の. As I have written, phrase connected with の “explains” the noun 文章, so I have translated it as “about”.
This is a case of a certain pattern:
Phrase + かという/かの + Noun
Phrase + という/との + Noun
Where the noun is an activity of expressing ideas or passing people information like 話 (chat/story), お知らせ (notification), 文章 and so on. The phrase is used to explain what the noun is about.
So you can rephrase かの to かという without changing the meaning:
何になりたいかという文章を書き終わったら、絵を描いてください。
I hope it helps,
Cheers!


all your questions are true questions just some answers are found in a different place 

