I don't think she actually got a head transplant. It's something she simply dreamed.  The woman she's talking to is her shrink.  The dream was telling her that we are doomed to repeat ourselves and she realizes that with proper therapy she can beat her problems. 