The file extension does not determine what format a file is in; they exist so that applications can identify and open their respective known filetypes, and secondly so users can see what type of file it is (although some file explorers, notably Windows Explorer in Windows 7 and later by default, will hide the file extension if the extension is known).
Most file types contain a file header or "magic number" in the first few bytes of the file that are unique to the particular file type. Tools such as the UNIX file
utility exist to read and identify files based on their magic number. Changing or removing the file extension does not affect the contents of the file and thus does not diminish the ability to recover the file type with this method.