Changing subject and verb positions in statements and questions

Solution 1:

In all the cases you reported, the second sentence is the correct one. It is similar to the word order in They asked who I was.

Solution 2:

The general answer is that you only move the verb ahead of the subject within a main clause. All of your examples have WH-movement within an embedded clause.

  1. What have you been doing today? (main clause)
  2. I asked [what you have been doing today]. (embedded clause)
  3. I am annoyed because of [what you have been doing today]. (embedded clause)
  4. Can you tell me [what you have been doing today]? (embedded clause)
  5. [What you have been doing today] annoys me. (embedded clause)

To know whether you are dealing with the main clause or an embedded clause, you have to think about what is the main verb of the whole sentence.

Solution 3:

Number 2 is correct in each case.

The reason for this is that "what" and "how" are being used as relative pronouns. If the clause which follows it has a subject, it comes before the verb.

Compare that to a question, where the verb comes first, e.g.:

What are you talking about?

versus:

I don't understand what you are talking about.