Several years ago I was teaching a Chinese teacher training course. One of my students was a native of Taiwan and was a Chinese teacher at one of the international high schools in Beijing. She related the following story:
One day after a long day at work teaching beginning level Mandarin Chinese courses, she stopped at an outdoor market to buy something. She approached a booth to inquire about the price of the item. The vendor had his back to her when she said,
“你好, (name of the item) 多少钱?” nǐ hǎo, (name of the item) duōshǎo qián
“Hello, how much is (name of the item)?”
Without turning around, the man gave her an astronomically high price. Because she was Chinese, she was offended that he would quote her such a ridiculously high price, especially since she knew the value of the item. She laid into him in Chinese berating him for suggesting such a high price. He wheeled around in surprise and said,
“对不起，我以为你是外国人”。duìbùqì, wǒ yǐwéi nǐ shì wàiguó rén
“Sorry, I thought you were a foreigner.”
Being a native of Chinese, the vendor certainly did not mistake her for a foreigner because of her Chinese language skills; it was because she initiated this exchange with 你好. An outdoor market like this is very informal, and a formal greeting like this is simply unnecessary and not used among the Chinese. For an American, it would be natural to offer a simple greeting in this kind of context. So, how would a Chinese (and how should you) greet someone in this kind of situation? They wouldn’t use a greeting. They would simply ask how much the item cost.