At the School of Friendship, after reading Star Swirl's postcard, Twilight expresses to Rarity that if Star Swirl truly wants to learn about friendship, he could enroll at her school. Cozy Glow enters Twilight's office with a mail delivery: a large stack of crates with sewing machines that Rarity plans to use for her friendship classes, and a stack of flyers. When Twilight looks at the flyers, she is shocked to discover that there is another School of Friendship located in Las Pegasus.

"Friendship University?!"

— Rarity

Welcome to Friendship U

As news about Friendship University circulates around the school, particularly its promise of teaching friendship in half the time as Twilight's school, Twilight and Rarity decide to investigate. Upon arriving in Las Pegasus, they find that Friendship University doesn't look like a typical educational institution and that it is run by the Flim Flam brothers.

Through their signature style of song, Flim and Flam advertise that their university can teach ponies about friendship in half the time as the School of Friendship and use Twilight's presence in the audience as proof of its legitimacy. When they also mention that the school is about to be officially accredited, Chancellor Neighsay of the E.E.A. appears, much more accepting of Flim and Flam's school than Twilight's due to its pony-only environment.

Even Star Swirl believes in Flim and Flam's change of heart.

When Twilight casts suspicion on Flim and Flam's teaching skills because of their past actions, Neighsay accuses her of trying to undermine the competition and monopolize friendship lessons. As Flam oversees student enrollments, Flim and Neighsay give Twilight and Rarity a tour of the university. When Twilight continues to doubt Flim and Flam's true motives, Flim tries to convince her otherwise by revealing that Star Swirl the Bearded is enrolled at the university.

Upon seeing Star Swirl enrolled as a student, Neighsay is fully convinced and gives Flim and Flam's school full E.E.A. accreditation. Twilight is heartbroken that her idol would enroll at Flim and Flam's friendship school instead of hers, but Star Swirl states he is simply following what Twilight taught him about friendship and giving the Flim Flam brothers a chance to change their ways, especially since they don't even charge money for classes. However, Twilight still firmly believes that Flim and Flam are up to something.

Infiltrating the university

Rarity poses as a student in Flam's class.

In order to find out what Flim and Flam are truly up to, Rarity employs her investigative skills and knowledge of Shadow Spade novels to disguise herself and Twilight as university students—though Twilight's disguise consists only of an eye patch and a sticky note over her cutie mark. Twilight tells Rarity to enroll in some classes and find out what Flim and Flam are teaching while she looks around the rest of the school.

In Flam's class, Rarity—going by the alias "Plainity"—discovers that fundamentals of friendship such as generosity are part of the lessons, and when she expertly demonstrates generosity for the class, Flam chooses her to be his star pupil. Meanwhile, Twilight sneaks into Flim and Flam's office to dig up dirt on the brothers. However, all she finds are lesson plans that are true to the core values of friendship, and she is unable to find any proof that Flim and Flam are scamming ponies.

Flim and Flam blackmail Twilight with an incriminating photograph.

All of a sudden, Flim and Flam appear and catch Twilight in the act of trying to undermine their university, and they take a photograph of her doing so. Flim and Flam tell Twilight to stop investigating their school, or else they will leak the photograph to the press, destroy Twilight's reputation, and ensure that no one else enrolls at the School of Friendship. When Star Swirl appears with a completed stack of worksheets for Flim and Flam, he discovers what Twilight is doing and expresses his utter disappointment in her. Backed into a corner by Flim and Flam's blackmail, Twilight begrudgingly agrees to their terms.

Flim and Flam's flimflam

Rarity falls for Flim and Flam's scam.

Rarity garners a considerable amount of popularity with the other university students in her "Plainity" persona. When Twilight regroups with her, she explains what happened in Flim and Flam's office and admits that she is a little jealous that Star Swirl enrolled at their school instead of hers. As she considers the possibility that Flim and Flam really have turned over a new leaf, Rarity decides to return the sewing machines she purchased so she can buy more worksheets from Flim and Flam. Twilight realizes that while Flim and Flam don't charge money for ponies to enroll at their school, they charge exorbitantly for the student worksheets.

"...This is the scam, isn't it?"

— Rarity

After watching Flim and Flam charge a student all the bits he has for their lesson worksheets, Twilight decides to risk her reputation for the sake of exposing the brothers' scam. She follows Flim and Flam to their office and sees them enter a secret room, where they funnel the money they got from their students into the expansion of their Las Pegasus resort. Twilight enters and exposes the brothers' true plans. Caught in their deception, Flim and Flam try to make a deal with Twilight—she keeps their plans secret, and they don't leak her incriminating photo to the press. Twilight refuses, saying her reputation isn't worth it if ponies are being taken advantage of.

Twilight uncovers the truth behind Flim and Flam's university.

Pressed about their lesson plans, Flim and Flam reveal that they simply copied from Twilight's School of Friendship guidelines. When Twilight suggests returning the money to the students and teaching friendship lessons for real, Flim and Flam refuse and state they almost have enough money to realize their goal. However, Rarity and Star Swirl suddenly enter, and having overheard everything Flim and Flam just confessed, Star Swirl demands that they refund the students' money and close Friendship University.

Epilogue

With the university students having nowhere else to learn friendship, Twilight welcomes them to enroll at her school.

As Flim and Flam return the money they collected from the university students, Star Swirl commends Twilight for once again being an upstanding example in friendship, including risking her reputation in order to stand up for what she believes in. When the students wonder how they are going to learn about friendship now, Star Swirl recommends that they enroll at Twilight's School of Friendship in Ponyville.

Some time later, back at the school, Twilight reads another postcard from Star Swirl, who promises that if he ever decides to go back to school, Twilight's school will be his first choice. As Rarity wonders how Flim and Flam got a copy of Twilight's school guidelines in the first place, Cozy Glow enters and double-checks with Rarity about keeping the sewing machines she purchased. Rarity confirms, having learned from her experiences at Friendship University not to give up when standing up for one's beliefs.

Flim: [echoing] Welcome, friends! You are about to embark on a journey of amazing magnitude! One that will change your lives forever!

Flam: [echoing] Prepare yourselves to embrace a new path and become students of...

Flim and Flam: Friendship U!

Twilight Sparkle: How can anypony learn friendship in half the time?

Flam: Our coursework is so accelerated, to take longer would be a crime!

Chancellor Neighsay: The Equestria Educational Association has taken an interest in institutions that teach friendship in a pony-first environment. Surely you didn't think your school has a monopoly on the concept?

Rarity: Oh, please. I think I know a disguise when I see one. Take off that ridiculous beard... Flam!

Star Swirl the Bearded: I spent a thousand years thinking the worst of a "bad" pony. You taught me to look for the best in him. Whatever Flim and Flam's past may be, starting this school shows they want to change for the better.

Chancellor Neighsay: I understand feeling threatened by competition, but my word, Princess. I wonder if the ill manners of the creatures at your school aren't contagious. I think I will take my leave before I become infected.