"Why didn't (or did not) somebody do something?" or "Why did somebody not do something?"

Solution 1:

Either works from a grammatical perspective, but usually a native speaker would say

Why didn't somebody do something?

The other way is not wrong.

Why did somebody not do something?

Putting the not outside of the normal order causes more emphasis to be placed upon it, a rhetorical figure known as anastrophe. From NOAD:

anastrophe |əˈnastrəfē| noun Rhetoric
the inversion of the usual order of words or clauses.