Well, this isn't exactly proved as yet, but here's my $0.02 on portraits, to answer your "if they're dead, how can they talk?" question:
I don't think the portrait is actually THEM... if it is, then what's the point of dying, right? Why would people make such a big fuss about death? I think it's just an "imprint" of their personality - magic or whatever done so that their personality can be kept in a portrait. It's not them, but just a picture of them that holds some of their characteristics. Like Phineas's portrait would probably say stuff that Phineas himself would have thought of saying - it is, however, NOT Phineas and does not reflect the whole Phineas. Same goes for Dumbledore - now that he's a portrait, he might be able to give Harry sound advice, but nothing he couldn't have given Harry before he died, and probably nothing that is significant enough.
How portraits travel from one frame to another is a mystery. It's perhaps just a characteristic of a portrait.
And, yes, Dumbledore's portrait is up in the Headmaster's office.