This link should explain caliper testing to find body fat percentage.
http://www.linear-software.com/online.html YOu can buy calipers ranging anywhere from $20 to $200. A Lange caliper will go fo about 200. More accurate because of the spring loaded action. There's tons of articles about measuring BF% on this website as well if you're curious as to how it works and why it works.
You can also do a search for how to determine it using a tape measure. That's probably the cheapest way and easiest for a beginner, but least accurate. It's not accurate in terms of calculating your actual body fat percentage, but i'm sure it's accurate in determining actual changes in body fat %, if that makes sense to you.
I, personally, just went to a local university for hydrostatic weighing. Thats when they weigh you as normal, then weigh you under water. Fat floats, so whatever you weigh under water is your lean body mass. Subtract LBM from total body weight and you have your fat weight. Divide your BF% by your total body weight and you have your BF%. This is the most accurate method, and I
highly reccommend it for at least the first time. I've never seen anyone reccommend it as vehemently as I do, but it will save time in trying to figure out how many calories your body needs to maintain, gain weight, and lose weight. Weight meaning either gain muscle or lose fat, ideally.
That's the whole point. Figuring out how many calories your body needs. You'll need to track it along the whole road to fitness as well, because as your body composition changes, so will your caloric needs. The Hydrostatic test cost me $40 and, like I said, is a long term thing. I probably won't go back for another 3-4 months. It gives me some added confidence when figuring out my diet, because I know that if when I go back I don't have the results I expected, it's that much less likely that I was just eating the wrong amount of calories, and it's more likely I was doing something else wrong like eating the wrong types of food.
That's the root of all the mathematical stuff. I'd reccommend Danmirage's primers for Losing Fat and Gaining Mass. I'm not going to lie, all this stuff is pretty technical, but don't let it scare you. Sometimes it can seem like "Wow, that's so strict that I don't even think I can follow that." Most people make compromises and have certain things they have to do that technically aren't so good (like eat certain foods, in moderation) but are good for them in the long run in the sense that these not-so-good habits at least keep them in the game overall. If you hate broccoli and have to put a little salt on it, so be it. Just don't do it all the time, ya know what I mean?
And then, you can guage how important it is you eat a perfectly clean diet by checking your BF% regularly, comparing it to your goals, and making a decision.
The main thing to remember is that what you want to do is change your body composition, not just lose or gain weight. If that was it, it'd be easy. You could just eat 3 tv dinners a day, making sure your calories are half of what you need, and go running every night. You'd lose a lotof weight, but it'd mostly be muscle, and then you'd be shooting your metabolism down, since muscle = metabolism. Furthermore, you'd look the same only smaller, still have the gut, just weigh less. Likewise, if you wanted to gain weight and just ate fast food way over your needs, you'd gain weight but it'd mostly be fat, and the same thing would happen.
See how rapid weight loss is so bad? It's basically as bad if not worse than unrestricted weight gain. Its all about controlling how your body changes on your terms. So be careful when starting out, because you'll want fast results and will be tempted to starve yourself and do too much cardio. By all means, work out! But make sure you're eating only 500 calories less then your daily needs, max. Don't go any less than that or your body starts storing food as fat, because it thinks you can't "find food" - it's a survival mechanism from our ancestors.
Sorry to be longwinded. Hope this helps. Read Danmirage's articles, stay informed. Knowledge is power. Stay in school, and don't do drugs.