To appreciate Mauritania culture try and learn some Salaam Alaykum and use it when greeting people. If you are a man, don't try to shake hands with a woman, and vice versa (note that some African women will not have a problem with shaking a man's hand, but it is best to not try to initiate contact, just follow their lead). You can, however, say hello and touch your hand over your heart.
Be careful to eat with your right hand, especially outside of Nouakchott where you may not be offered silverware. Like other places in the Arab world, the left hand is reserved for the bathroom. If you're left-handed... try hard.
In Mauritania culture covering your head isn't required, but it is polite. It may cut down on the Madame ou bien Mademoiselle? question, but Westerners, especially women, will be the target of unwanted attention and minor harassment everywhere in the country. Be aware though, that many Mauritanians, both male and female, think that a direct gaze is a sexual invitation.
There is even a phrase in Hassiniya, ayna m'tina, meaning strong eyes, to describe what many people feel is an aggressive act. Just because you are in a foreign country doesn't mean that the men have carte blanche to be jerks, though. Calling them on their bad behaviour, or pointing it out to the ever present bystanders, can often work. If you give respect, you can demand it also.
The Moors respect women who stand up for themselves (even while they push you to see how far they can get).
If you are travelling with someone of the opposite sex, avoid touching in public. It's actually much more common to see two men holding hands than a woman and a man. As far as dress, the more skin you show, the more negative attention you will receive. In Nouakchott, women can wear trousers, but avoid tank tops and to-the-knee skirts. Long skirts are the best choice for women. It is a good idea to cover your arms also.
Trousers display the crotch area and thus are also disturbing, especially to people in the countryside who aren't as used to seeing this as the city folk. Most people will be very polite, and you will not know what they are thinking.
If you are a female, there is no non-sexual reason, EVER, to go off in private with a man. If they ask you to step into an office, or back of a shop or anywhere; don't. The men are aware that that is an unreasonable request, and no one would ask you for a private chat if they meant well.
If you allow yourself to be alone with a man, for however brief a time, everyone will assume you had sex and will judge you accordingly. As a weakling, not as dissolute. In fact, if you have a boyfriend, not a series of boyfriends, most people are a bit flattered. The men are pretty uninhibited, very sensual, and can be lots of fun.
If you are an LGBT visitor, do not try to be open about your sexuality to any Mauritanian. They will act very harshly to this. Also do not make any acts in public that would imply the fact that you are LGBT: Mauritania imposes the death sentence for homosexuality.
If you are white, Nasrani, Toubac and Toubab refer to you. Little kids and sometimes rude adults will refer to you by this name. Nasrani actually means a person from Nazareth. Since Christians follow Christ's teachings, and Christ is from Nazareth, then Christians are all honorary Nazarenes.
Beware of people who may try to take advantage of your politeness in order to try to make a sale. Be aware that in market areas, almost everyone who tries to befriend you is trying to sell you something at an inflated price. They will try many tricks to get you to buy items from them (including "giving them to you as a gift"), and a few might even accuse you of not liking Africans if you decline to look at their souvenir shop.
If someone is going beyond the normal limits to bother you, it is not impolite to tell them, without question, that you are not interested. If they ask for something that you own, just say that you need it right now, and can give it to them in a month or so.