Harry decides to take the egg to the prefects' bathroom on Thursday night, using the Invisibility Cloak and the Marauder's Map. The bathroom is magnificent; the bathtub is as big as a small pool and a hundred taps line the edge. Harry discovers that each tap carries a different bubble bath mixture and plays for a while before slipping into the bath. He opens the egg and still finds it unintelligible, but he drops it when he hears Moaning Myrtle tell him to put it in the water.
Moaning Myrtle's sudden appearance (and her choice to help Harry during his bath) reminds Harry that just because someone is annoying or unpleasant doesn't mean they're not helpful and worth consulting. However, it's questionable whether or not Harry truly internalizes this, given that he doesn't begin to reach out to others during the rest of the novel.
Myrtle assures Harry that she didn't spy on him while he got in the tub and complains that he hasn't been to see her in a while. She covers her eyes while Harry fetches the egg and opens it underwater, where it begins to sing. Harry puts his head under and listens to the riddle: someone who can't sing aboveground has taken something, and Harry will have an hour to retrieve it. Myrtle gleefully watches Harry ponder the riddle and confirms that there are merpeople in the lake. Harry's heart sinks when he realizes that he's going to have to swim in the lake.
Aside from the obvious challenge of needing to breathe and swim underwater for an hour, the fact that the egg implies that Harry will meet merpeople underwater turns this partially into a test of how Harry and the champions will handle meeting individuals who are very different from themselves and are possibly positioned as enemies.
Myrtle is very offended when Harry asks how he's supposed to breathe, and he ponders the riddle more as she talks about haunting a former classmate. He gets out, says he'll try to visit Myrtle in her bathroom, and checks the Marauder's Map. Harry notices that a dot labeled "Bartemius Crouch" is in Snape's office and wonders why Mr. Crouch is at Hogwarts now. Curious, Harry decides to investigate. Halfway down a staircase, however, Harry steps through a trick step, sinks into the staircase, and drops the egg and the map. Stuck and hidden under the Invisibility Cloak, he can't reach either. Filch races towards the sound of the screeching egg and believes that Peeves stole it from a champion. Just as Filch starts up the staircase, Snape arrives and says that somebody has been in his office.
The news that Mr. Crouch is breaking into Snape's office forces Harry to think more about what he knows of Mr. Crouch. Most importantly, Harry doesn't realize at this point that Mr. Crouch has a son who shares his name; it's the younger Crouch that's in Snape's office. This offers the reader a way to see how Harry thinks about things when he doesn't have all the information, and shows that it's not necessarily Harry's fault for coming to incorrect conclusions--without more information, he can't reach the right ones.
Harry hopes that Filch will go investigate Snape's office, but Moody arrives. Harry realizes with a jolt that Moody can see him and Moody looks just as surprised to see Harry. Moody turns his attention to Snape and asks about his office, but Snape insists he doesn't need Moody's help. Moody insinuates that Snape isn't trustworthy and Snape convulsively grabs his left forearm. Moody sends Snape back to bed and points at the map, a "dropped" piece of parchment. Harry waves his arms wildly and Moody Summons the map. Snape, however, saw it and insists that Harry is around in his Invisibility Cloak. Moody makes Snape stop, takes the egg from Filch, and sends both men away.
For Moody--who is actually Barty Crouch--it's especially important to protect Harry in this situation, as Harry needs to be able to proceed and do well in the second task. By helping Harry then, Barty Crouch is able to develop a closer relationship with Harry based on breaking rules. This also illustrates how breaking rules and doing something objectively wrong like this can be a good thing in the end--Harry gets out of trouble, while Moody/Crouch earns Harry's trust.
Moody asks Harry what the Marauder's Map is and Harry explains as Moody pulls him out of the staircase. When Moody asks, Harry says that he saw Mr. Crouch in Snape's office. This seems to mean something to Moody, so Harry asks why Mr. Crouch would want to look in Snape's office. Moody says that Mr. Crouch is obsessed with catching Dark Wizards, and the two discuss the strange events going on and the rumors spreading thanks to Rita Skeeter. He asks Harry to borrow the map and in his relief that he's not in trouble, Harry agrees. They climb the stairs and at Moody's office, he tells Harry to consider a career as an Auror.
Moody's advice that Harry should think about being an Auror is laughable, given that this advice is actually coming from a man who was imprisoned because of Aurors. Moody/Crouch chooses to give this advice, however, because he understands that Harry is at a point in his development where he's just beginning to think more about what the future holds, but still wants the authority figures in his life to guide him in the right direction.