Focusing on mathematics, I think about two kinds of foundational books. 1. Historically foundational: books that brought important ideas, introduced a new branch, progressed the maths significantly. You can read them these days, but their content, proofs, language, etc. is not up to date. Examples: Elements by Euclid, Philosophiae Naturalis Principia Mathematica by Newton, Disquisitiones Arithmeticae by Gauss. 2. Modern foundational books: The ones that can be used for studying now. Books that are clearly written, popular, cover their subject well. Examples: Visual Complex Analysis, Spivak’s Calculus, Linear Algebra Done Right, Hardy’s An Introduction to the Theory of Numbers.
Also recommended in this reply