GIAM (a Gentle Introduction to the Art of Mathematics) is a free, open-source textbook -- the current version is 3.1. GIAM covers several topics in the foundations of mathematics (logic, sets, relations, functions and cardinality) and introduces the reader to many techniques of mathematical proof (direct, indirect, contradiction, contrapositive, mathematical induction, combinatorial proofs and magic). There are amusing quotations at the start of each chapter.
A very preliminary version in MBX.
The exercise workbook.
The hints and solutions manual.
Some links to reviews.
GIAM is licensed under the GNU Free Documentation License version 1.3
GIAM is typeset using PDFLaTeX. Figures were produced with XFiG. Photographs were modified using GIMP. The source code for GIAM is hosted at GitHub.
There are alternative versions of GIAM available here.