The Lagarias book is a compilation of papers by various authors about various aspects of the problem. Different papers have different prerequisites. Some of the more expository papers have essentially no prerequisites at all; for others, you'll want to know about dynamical systems, Markov chains, ergodic theory, $p$-adic numbers, Turing machines and undecideability, and, of course, elementary Number Theory. And each of these has prerequisites, e.g., ergodic theory is based on measure theory, Markov chains involve Linear Algebra, etc., etc., etc. But don't be disheartened! You don't need all these for every paper, not by any means, and a well-written paper will teach you something useful in its introductory paragraphs even if the rest of the paper is beyond you.
I think the best thing is to jump in, start reading something you find interesting, and then, if you get stuck, come back here to ask something like, "What do I need to know to understand the proof that all furbles are craginacs, as given on page 977 of Peeble and Zimp, The Elephant and the $3x+1$ Problem?" It's much easier to give prerequisites when you have a narrowly-focussed problem in mind, than when it's as broad as "I want to learn about the $3x+1$ problem".