What exactly is a core file and why is it useful?
A core file is, essentially, a dump of the memory and registers of the program at the time that it crashed. When viewed in a debugger, you can get information on where the program was at the time of the crash, as well as getting stack traces or viewing the state of heap memory. Basically it lets you do anything you could with a debugger attached at the time of the crash, short of actually running code.
It's basically a snapshot of a process's memory.
It's usually created automatically when process ends abnormally (e.g. segmentation fault).
It can be loaded by debugging tools like gdb
to try to determine the cause of the crash. For example, one can examine what the process was executing at the time of the failure, the values the variables had, the stack backtrace (the function that called the function that had the problem, the function that called it, and so on), etc.