Rapunzel is the secondary antagonist of DreamWorks' 14th full-length animated feature film Shrek the Third, the third installment of the Shrek film series.
She is a bogus member of the princess group and a friend of Princess Fiona. However, she later turns out to be Prince Charming's secret girlfriend and an ally of his to conquer Far Far Away with the help of the fairy tale villains.
Her name was seen at the gate at her tower home within the kingdom of Far Far Away in Shrek 2, although she was not seen.
Shrek the Third
Rapunzel was first seen at King Harold's funeral. Then, she was seen at Fiona's baby shower. When Prince Charming invaded Far Far Away with his army of villains, Rapunzel betrayed all the other princesses and brought them to him so she can be with him.
Then, she took part in a play with Charming and his friends, playing as the role of a princess being trapped in a tower. When Charming is seen on his horse inside of a giant decorated clam-shell, she is impressed by his performance. During the final battle, Gingy uses her long hair to descend from the tower. Her hair falls off, revealed to be a wig.
Shocked and humiliated, Rapunzel abandoned Charming and ran away never to be seen again. It's unknown what became of her after Charming's defeat, but it can be implied that Artie had Rapunzel arrested due her cooperation with Charming or Rapunzel just left Far Far Away.
She is well-recognized of being a fraud later throughout the film. An example of this is when she betrays Fiona and the other princesses, so that she can be with Prince Charming. It is unknown why Rapunzel was in love with him in the first place. Rapunzel is appears to be more focused on certain things (or objects), like when she constantly sips her cup of tea at Fiona's baby shower and saying only a few words. Meaning, that she does not care about what was actually going on.
Despite all these negative traits, Rapunzel does seem to have some standards unlike Charming. This is demonstrated when she asks him why he's not going to spare her friends from a punishment, indicating that she had asked him previously to not be so rough with them. However, in the end, Rapunzel cared more for herself, which eventually leads to her humiliation.
Despite being a villain, Rapunzel was depicted in some posters as being with Fiona and the other princesses in their fighting poses. This may have been done to hide the fact that Rapunzel was actually a villain or may be an indicator that an early version of the film had Rapunzel as one of the heroes.