So many lines from Shakespeare have become part of our culture and language. You have provided a good example. Also consider "all the world's a stage" and "to be or not to be, that is the question." Sometimes we don't realize the origins of what we say.
The actual quote is from the Bible. Ecclesiastes, 1:9:
What has been is what will be,
and has been done is what will be done;
and there is nothing new under the sun.
However, in Sonnet 59, Shakespeare explores the same theme:
If there be nothing new, but that which is
Hath been before, how are our brains beguil'd,
Which labouring for invention bear amiss
The second burthen of a former child.
Oh that record could with a backward look,
Even of five hundred courses of the sun,
Show me your image in some antique book,
Since mind at first in character was done,
That I might see what the old world could say
To this composed wonder of your frame;
Whether we are mended, or where better they,
Or whether revolution be the same.
Oh sure I am the wits of former days,
To subjects worse have given admiring praise.
You can find out more about Shakespeare's sonnets and the quote from Ecclesiastes from the links below. I have also posted your Question to the William Shakespeare Group, in case others have alternate quotes to offer.