There are many ways to view the contents of a compressed file without extracting/decompressing it. That all depends on the type of compressed file it is and which applications can support it. There are probably hundreds of different compressed file types and thousands of applications that can read them, so an exact answer to this question isn't possible.
If it's a .ZIP file, the easiest in Windows XP and later, if Explorer is the default application for opening .ZIP files, would be to simply double click it.
Alternatively, you can install a 3rd party application like WinRAR or 7zip to view the contents if it's a common compressed file type.