Since Pathfinder take origin from D&D 3.5 Edition I think we can refer to D&D FAQ v.3.5 78 Update Version: 12/21/07
Is it possible for detect magic to locate an invisible
creature?
Yes, although not very efficiently. Remember that detect
magic reveals the location of magical auras over the course of 3
rounds. A creature rendered invisible by a spell or magical
effect could be located via detect magic, but only after 3 rounds
of concentration. Furthermore, the invisible creature must
remain within the spell’s area for the entire 3 rounds of
concentration; if the creature moves out of the area, the process
must start again from the beginning. However, even if
everything works according to plan, you still don’t necessarily
know that you’ve found an invisible creature—at best, the
caster of detect magic would know that she had located a faint
aura of illusion magic in a particular space.
Can you use detect magic to detect supernatural effects?
For example, can it detect a wildshaped druid?
Supernatural abilities are magical, and thus their effects
would produce magical auras. Although the detect magic spell
doesn’t have a line entry for supernatural effect, you can use
the same line as “Magic item (caster level)”—a supernatural
effect’s caster level is equal to the creature’s Hit Dice unless
noted otherwise (Monster Manual, page 315).
Can detect magic be used to identify magical traps?
Would nondetection block this?
Detect magic locates magical traps, but it can’t identify
anything more than the location and strength of the aura
revealed (and, with a successful Spellcraft check, the school of
magic involved). Thus, technically the spell doesn’t actually
reveal the fact that the magical trap is, in fact, a trap.
Nondetection wards a trapped object from detect magic
(requiring a caster level check to pierce the nondetection). An
even better option is Nystul’s magic aura, which can conceal a
magic trap’s aura (or change it to appear as that of another spell
of your choice).