Is an apostrophe necessary when you are referring to a set of years? Is the correct version 20s or 20's? (Twenties)
This completely depends on the editorial conventions of whatever venue you are thinking about, although most formal guidance will advise you against using the apostrophe.
The MHRA style guide (p46), for example insists on using an s without apostrophe. This is the trend for literal sense in the disciplined, academic guides with which I am familiar.
On the other hand, a reasonable argument for casual clarity supports the idea of including a non-possessive apostrophe as a marker to indicate that you are not writing some surprisingly obscure mathematical Thing. Grammourpuss gives a pragmatic view.
At the vernacular level, this is close to the matter (in the UK, at least) of what has become known as 'the grocer's apostrophe', thanks to high-street signs advertising the availability of apple's and pizza's.
If you are writing for some other body then they should be able to provide their own style guide to sort this out in any given instance. If you are trying to establish a personal style for (e.g.) a blog, then at the moment the choice boils down to your sense of your readership.
Personally I would simply not use the apostrophe. If you have an editor, then he or she will just put it in anyway if that is what they want.