Search around Solitude for Dervenin. When he asks for help, ask him about what he needs help with. He will explain that his Master has abandoned him. He will explain though that his Master is having tea with someone in the Blue Palace, who is above the Jarl. He will mention the Pelagius Wing, the forbidden section of the Palace is where his master went.
Once inside the palace, turn to the left and head to the West. You want to find Falk Firebeard, Erdi or Una. They are the ones who can let you inside the Western Wing. Edri and Una require a low difficulty speech check which is very easy to pass with 15 or so speech. If you have completed The Man Who Cried Wolf, then you can convince the Steward, Falk Firebeard to let you in.
Go to the Western door and open it up with the key that you receive from any of the three sources. Once inside, head up the stairs. Head up the stairs to the left and get to the second level. Continue to the right at the top of the stairs. Head through the cobwebs to the South. Just keep following this passage and you will be taken somewhere else.
This leads to a field. You find Pelagius the Mad and Sheogorath talking over tea. The pair tire of each other company. Pelagius will depart. The Dragonborn can approach and ask who to get out of this area. Sheogorath he will leave if you find a way out first. To this end, he will give you the Wabbajack and put you in Fine Clothes and Fine Boots. Look around the area and you will see 3 Archways. You will need to head into each one and get through the activities inside. Try to talk with Sheogorth between each instance for some interesting dialogue.
To the East you will come Pelagius' Confidence and Anger.
You will want to use the Wabbajack to hit the small Pelagius twice. This will grow him to his full size. You will also see 2 spectral Self-Doubts come in and attack as well. A hit from anger will reduce the Confidence's size. Just blast it again with the Wabbajack if that happens.
To the Northeast you will find Pelagius the Tormented laying down on a bed. Sheogorath will explain that you simply need to wake up Pelagius. Blast him with the Wabbajack. This will summon a number of Wolves. Blast each in turn with the Wabbajack to turn them into Goats or an assortment of other things. You will need to hit Pelagius then whatever appears 5 times.
To the West is a gate as well. Through there you will find Peligius's paranoia. Look across the arena. Blast the guard to the left of the throne with the Wabbajack. This will cause something to happen to them. Sheogorath will congratulate you on figuring out who to blast.
Head back to the center of the area and talk with Sheogorath. Tell him that you have completed the task that he asked of you. He will admit that you have done just that and will honor his agreement to return to the Shivering Isles. He will summon in Dervenin who seems to be Sheogorath's luggage from the Shivering Isles. He will also give you the Wabbajack to keep, as well as the nice clothes.