@ankara-- It's actually even older than Shakespeare's use of it. He's definitely one of the first people to include it in their literature, but I'm sure it was in use at least twenty or thirty years before Shakespeare used it.
@burcidi-- That's a good point and I understand what you mean. The thing with most idioms is that we don't have a clear historical account of who used it first and how it came about to be.
My friend, who is an English major, has told me that this phrase was first used by the Dutch. When someone was in a bad situation where they felt embarrassed, they would say that the person "is in the pickle."
I'm not exactly sure, but it probably originated from the fact that the brine used to make pickles is very strong. It's a combination of vinegar and salt which breaks down and maintains food at the same time. Imagine if someone were to sit in a pickle brine for some time. They would feel horrible-- very uncomfortable. I think that's how the idiom came to be.