'I wonder what he's doing.' or 'I wonder what he's doing?'

Is the sentence ‘I wonder what he’s doing.’ a declarative (stating that you are wondering what he is doing) or an interrogative (asking what he is doing)? I heavily lean towards the former, but I’ve seen both used in presumably learned prose. Which is correct?

The correct answer, Derleth, is not to get too carried away with categorizations.

In a technical sense the sentence is declarative, but it is probably used as a question. “What” is an interrogative pronoun, so the sentence has elements of both declaration and interrogation.

Not to upset your English teacher, or whomever, but it is possible for the sentence to be considered to belong to both, or else some third category that is neither. Why does it matter?

No way. It ends in a period, period. That is not a question – it is a statement of fact.

Now, this is OK I think:
I wonder: what is he doing?

akin to:

We must ask ourselves, “What do we have to fear?”

pluto: I haven’t had a grammar teacher in a while. I want to know because I’m naturally curious.
jumllaney: Thanks. That’s what I thought.

Yes, JMullaney is right. It is a declarative sentence. It is merely stating that someone is wondering something.

I wonder why he is asking this. Should we ask?

Yeah, it ends in a period. It’s the equivalent of, “I am thinking about what he is doing.” Or, “I am pondering his activity.” Ecetera.

On one hand, yes, the sentence should get a period at the end. On the other, it is really being using as if it were a question. Sentences can be used to imply different sentence types than what they are on the surface. For instance, suppose someone says your example to another person:

“I wonder what he’s doing tonight.”

It would be reasonable for the other person to reply something like:

“I’ll bet he’s sitting at home alone, crying his heart out.”

Thus even though the first speaker has used a declarative sentence, the second person understands that he is really asking a question. This can go the opposite way too. If one person says to someone’s suggestions:

"Are you crazy?’

It would be reasonable for the other person to take that as if it were a statement, not a question, and reply with something like:

"No, I’m not crazy. I thought I was making a perfectly good suggestion.

These ways of understanding one sentence as if it were really another are part of what’s called conversational implicature in linguistics. Back when I was studying linguistics years ago, there was a lot of study done on this, but there were never any conclusive results on it, and I think it’s not studied much anymore.