I haven't read the book, but whether the F-word is offensive or "low class" depends on the context. Personally, I don't think that The President (or a politician who is planning to run for the office of President) should use the word -- unless, perhaps, he's giving positive encouragement "to the troops". (Cf. "If you don't let us f*ck this *sshole, there's going to be sh*t all over everyone's c*cks and p*ssies, from Team America. In other words, everyone expects soldiers to use the F-word, so if a leader is talking to soldiers, then it's probably okay to say it!)
Another context where it would be "okay" for the President to use such language would be if he was trying to describe how he habitually talked when he was a much younger man "who didn't know better." Again, everyone expects that guys aged 15-25 use the F-word all the time, and it's not the slightest bit scandalous if an old and distinguished gentleman admits that he spoke that way as a young man. So if Obama wrote that "when I was 20 years old and in college, I didn't trust the mother*ckin' establishment," I don't think any American would be offended.
On the other hand, a lot of people were shocked by Nixon's obscene language in the Watergate tape recordings, because Nixon was about 60 years old at the time!