What is this or What this is.

What is this
What this is.
I am quite confused when to use those above expressions.
I know that we use the second one during indirect speech and first one when used within quotations or in question separately. Anyway I see the first one in normal sentences without quotations. I can’t recall those sentences. Could you please help me in clearing me this doubt?

Here’s an another one accidentally used by me in this post.

“When to use these expressions”----a question
So in indirect speech it should be --I am quite confused when those expressions should be used.
But this also seems to be feasible---- I am quite confused when to use those expressions.

My guess–That second sentence wasn’t indirect speech at all. What is such kind of sentence?