The aim of this text is to provide an account of the fundamentals of thermodynamics which is accessible at graduate level to physicists, mathematicians and philosophers of physics. The bulk of the book (Chapters 2-9) is based on the algebraic approach of Lieb and Yngvason, but extended to encompass both positive and negative temperatures and systems in which entropy increases and decreases in adiabatic processes. We show that these four possibilities are already present in Carathéodory's version of the Second Law which arises as a theorem from the axioms. We develop generalized versions of the Kelvin-Planck and Clausius formulations valid for the same range of systems. The parallel development in Chapter 10 takes a geometric approach. We discuss the limitations associated with the local nature of Carathéodory's Principle and present the resolution of this problem due to Boyling. Part of the aim here is to substantiate the claim of Arnold that the mathematical structure of thermodynamics is contact geometry. The last two chapters of the book extend the scope of the discussion to, respectively, critical phenomena and non-equilibrium systems. Chapter 11 is a presentation of phase transitions and critical phenomena in which we discuss universality and use scaling theory to derive scaling laws. Chapter 12 contains a generalization to non-equilibrium. We present the extension of Lieb and Yngvason's work to non-equilibrium and also give a brief account of classical irreversible thermodynamics (CIT). The latter enables a possible understanding of the way that the lack of a unique entropy function in the Lieb and Yngvason non-equilibrium approach can be resolved. The book is completed by a set of appendices which provide mathematical and physical support to the work in the main text.