There are various ways to EQ.... physically - by using outboard gear or your mixer's EQ - or "virtually" - using s/w plug-ins. There are also different places to be applying EQ in the recording process - during tracking, during mixing, and during mastering.
Here are some guidelines to follow to help narrow down the when/where.....
The addition of EQ into the signal chain always results in "some" compromise of the waveform by introducing phase-shifts (time-based artifacts that can results in comb-filtering of the waveform) - especially when boosting frequencies. Cutting frequencies can result in less of these artifacts, so it is generally advisable to apply EQ by cutting frequencies you don't want, rather than boosting the ones you want to enhance - a practice known as subtractive EQ. The quality of the EQ itself also dictates the artifacts - cheap EQ gear means more artifacts, mastering-grade EQ means significantly less (for comparison, a Weiss EQ-1 used by mastering houses runs about $5500 US)...
So, using EQ to shape sound is a bit of a compromise - yes, it changes the signal, but it introduces "some" small signal degradation.... SO - the obvious solution is DON'T USE IT --- er, at least, not until absolutely necessary. "But wait...", you say, "I NEED it, my guitar/bass/drums don't have THAT sound..."
Well ok... for line-level instruments such as synths, you certainly can use EQ to shape the sound.... but for mic'd sources, it's much better to use mic selection and mic placement to get the sound you're after, rather than reaching for the EQ knobs.... for example, don't brighten an amp by boosting your hi-shelf EQ, change amp settings, change guitar PUPs, change amps, move that mic closer to the center of the cone... if you're not getting the sound you want, maybe you're using the wrong instrument/amp combination!
Another point to keep in mind - try to get your tracks sounding the way you want DURING tracking - if the tracks "to tape" are sounding the way you want them, then selecting sounds during overdubs become much easier. And even better, during the MIXING phase, you'll find your tracks will blend better (since you've already blended them correctly in the tracking process!) Best guideline to follow: never "fix it in the mix" - fix it NOW - move a mic, change the mic, change the source, move the source, switch rooms. If none of these work, THEN reach for EQ!
During mixing - if you've done your tracking homework, there should be less work needed in getting the tracks to fit, since you've taken so much care during the tracking process. But very likely, there are still some tweaks you'd want to make.... I strongly suggest you adopt the subtractive EQ approach - cut instead of boost. If there's too little highs, remove some mids or bass to shape it. This does two things - minimizes phase-related artifacts, and more importantly, reduces unnecessary signal level that will eat into your mixer's headroom (since cutting will reduce the amount of frequency "space" a waveform will take up.)
The last place for EQ - mastering - this phase of the production is for polish. Unless there's a need for a rescue operation, you're going to see very small applications of EQ - maybe 1-2db at most, applied in a range of small frequency increments rather than a cut/boost at a single frequency.... again, a subtractive EQ strategy is adopted as a preference. Generally, if you have to add a lot of EQ during mastering, something else was wrong during the tracking and/or mixing stages - could be a problem with the room acoustics or your monitoring chain.......
The other point to remember about mastering - it's usually beneficial to let someone else's ears judge the sound of your mix, so it's actually an extremely good idea to take it outside for mastering.
Of course, it all depends on the seriousness of the product involved -- if the project is simply for your own enjoyment and you plan on giving a few copies to some friends, fine - go the Do-It-Yourself route... if it's a more serious project to the point of shopping it around or even selling it outright, DIY mastering most-definitely will not cut it!