I admit I'm a little touchy about my age because I've had it used against me in an attempt to invalidate my opinions or feelings (e.g. "I'm older, I know better", "You just don't understand, you'll understand when you get older", "You don't know what crushed is" in reply to me saying I was crushed at the prospect of losing a longtime close friend) or for assumptions to be made about my experiences. I try not to show it, though. If it's someone I'm not likely to see again or would only see in passing, I try not to give an exact number (at most, something like "Oh, in my 20s", though the responses in the other thread have given me ideas for other good answers). For people I'll have close and repeated contact with (e.g. relatives), I've just given the number. Though I had a cousin's wife (er...cousin-in-law?) say, upon hearing my age, "When I was your age, I was already married and had two children!" (I'm single and childless). People are always surprised when I do say how old I actually am.
Very rarely do I outright ask anyone theirs. If they're close friends they'll either tell me outright or I can guess from what I know about them. As others have said, I'd pretty much only ask if it's directly relevant to me (i.e. a dating prospect or if we're doing an activity that requires everyone be of a certain age).