The intent of your question seems to be, "Which e-books formats are safe to buy (or obtain legally for free) - such that they will never go obsolete on any future device I use?"
There are actually several approaches to this issue, but you first need to understand a little about DRM (Digital Rights Management):
DRM attempts to prevent illegal copying of books you purchase. DRM creates the following problem for honest consumers: Let's say you buy books protected by DRM from one marketplace. How can you read a book you purchased if you switch to a competitor's device that uses a different DRM scheme for the same or different format?
With that question in mind, here are several approaches you can take to preserving books you obtain for the long haul:
- You could elect to stick with the two most popular,
non-proprietary formats - epubs and PDFs - and never buy books that
have DRM. Store these books in a sharing service such as Dropbox and
you'll be able to easily open them on pretty much any desktop or
mobile device. Even devices that don't have Dropbox will usually
allow side loading of content when you hook them up to your PC.
- You can mostly do (1) above, but also purchase books that make
themselves available in the top 3 formats upon purchase (epub, PDF,
and one of Amazon's 2 formats). Many programming textbooks and
reference materials can be purchased this way. All purchases I've
made this way did not have DRM but even if they did have DRM, I
would be covered.
- You could choose an ecosystem that supports a wide variety of
hardware and stick with it. For example, Amazon goes to great
lengths to insure that books you buy from their Kindle store will be
readable on any Android or iOS device, as well as on a Mac or
Windows desktop computer. You are not locked in to always buying
Kindle devices. This is not perfect, however, as you won't be able
to read the Kindle on hardware that purposely keeps out Amazon
software, such as the Nook (SimpleTouch, Glowlight). However, if you
purposely stick to relatively open software platforms (Android, iOS,
Mac OS X, MS Windows) you won't have an issue.
I personally do a combination of all three. When possible to obtain books for free (legally), I do so, and store it in my dropbox "ebooks" folder. When possible to buy books in multiple formats, I do so. But in instances when I can't do either of these (or book price is so low I don't really care), I purchase from Amazon's book store.