Why do we say חזק חזק ונתחזק when we end each Chumash?
The Sefer Taamei Haminhagim brings three reasons:
(1) The Mederash says of the pasuk in Yehoshua (1:8), "this book of the torah shall not leave your mouth"; the word "this" implies that Yehoshua was actually holding a sefer torah at the time. Yehoshua had just completed it, and therefore Hashem said to him "chazak ve'ematz" (1:6,7). Abudraham infers from this that when one completes a sefer of the torah, we should say "chazak".
(2) Torah is something that requires strength to continue learning, as seen from a couple of Talmudic sources, so we wish ourselves strength in our continuation through the next sefer.
(3) It is in the same vein as when we say "hadran alach" after finishing a maseches, or saying "Yiasher Kochacha" to a chazan, meaning that we (or he) should merit to continue studying or doing mitzvos.
One cute theory: It used to be that the entire congregation would recite the last posuk aloud (like the pesukim on fast days, for instance) Therefore the instructions "Chazan v'kahal" were put next to the last posuk, in abbreviated form, חוק which looks a lot like חזק. This is discussed in one of R. Schachter's books on the Rav.