A creature threatens the squares in which it can make a melee attack, but does that include its own space? (If it's relevant, assume it's a medium creature.)
Yes, a creature threatens squares it occupies
As Hey I Can Chan stated, the section on Attacks of Opportunity says:
You threaten all squares into which you can make a melee attack, even when it is not your turn. Generally, that means everything in all squares adjacent to your space (including diagonally).
However, a section from Big and Little Creatures In Combat helps shine a little more light on the situation...
Tiny, Diminutive, and Fine Creatures
Very small creatures take up less than 1 square of space. This means that more than one such creature can fit into a single square. A Tiny creature typically occupies a space only 2-1/2 feet across, so four can fit into a single square. 25 Diminutive creatures or 100 Fine creatures can fit into a single square. Creatures that take up less than 1 square of space typically have a natural reach of 0 feet, meaning they can't reach into adjacent squares. They must enter an opponent's square to attack in melee. This provokes an attack of opportunity from the opponent. You can attack into your own square if you need to, so you can attack such creatures normally. Since they have no natural reach, they do not threaten the squares around them. You can move past them without provoking attacks of opportunity. They also can't flank an enemy.
(Emphasis added, note the tense difference between "they" (Tiny/Diminutive/Fine creatures) and "you" (player, assumed Medium by the Player's Handbook unless stated otherwise))
This shows that a creature is capable of attacking into their own space, which combined with the Threatened Squares text saying you threaten all squares you can melee attack into, indicates that yes, you threaten squares you occupy. This is further supported by natural reach for larger creatures including the entire area up to their maximum reach as threatened.
The use of the line "Generally, that means everything in all squares adjacent to your space" in the first section is simply meant to indicate the situation that will happen a vast majority of the time, not to indicate a restriction, as presumably most combats will not involve two creatures sharing the same space.
Indirectly related (but currently a hot topic in the comments), these are the rules regarding Tiny and smaller creatures ending their move in another creature's space:
Moving Through a Square
Very Small Creature
A Fine, Diminutive, or Tiny creature can move into or through an occupied square. The creature provokes attacks of opportunity when doing so.