--- Quote Start ---
(2) For libraries in VHDL, as I know, the library is used to tell the path, so if there is two modules with exact same name but they are in different libraries, then the world is still good. But I am curious when we use libraries in VHDL, we just write a command at the beginning of VHDL file. Where is the file of library? What is the extension of the VHDL library file?
--- Quote End ---
VHDL doesnt care where the source files are on disk. Thats up to the tool to decide. the library is just a concept/virtual container for code, so a single library can be mapped from difference sources.
Btw. Quartus will just ignore your nicely built library structure. It just searches all source for matches (it only cares where theres a conflict).