It's not on topic
...in my modest opinion. Even if it were on-topic as being about cultural norms, by itself, it's too broad, as it includes several questions in one. Though, as an exercise, we can single out the main questions included in the OP and analyze those:
Can it be considered rude or offensive to just start speaking mandarin if I don't know the person well enough?
It's impossible to answer this objectively. There's no universal social norm that suggests to start or not start a conversation in a certain language. You can and will find people with completely different and equally valid thoughts about this, as it really depends on the character, disposition and background of the interlocutor.
Moreover, it's also not possible to meaningfully restrict this question to the Mandarin language. What about Cantonese? What about German?
Without intending to sound racist in any way, shape or form, there are certain cues one can pick up on, like the appearance of someone and whether or not they speak with a Chinese accent. If I pick up on these cues, can I just start speaking mandarin?
Again, totally up to the specific context of the conversation.
It also might be a bit too intimate for someone to speak with a stranger in their native language in a western country.
"Intimate" is also a word with no clear-cut meaning, without context. A Swede might think that a hug is "intimate", whereas a Portuguese might think it's not. An extroverted Swede might think it's not, whereas an introverted Portuguese might think it is.
The currently accepted answer:
Chinese, Japanese and Korean are usually hard to recognize for a normal westerner, and each of these people are unhappy to be taken as another group of people... Even worse, if you take a Southeast Asian person as Chinese, Japanese, or Korean... So, it's risky to do that.
Can this statement be generalized to all Chinese, Japanese and Koreans? It can't. Counter-example: the interlocutor is an extroverted Vietnamese who did a semester abroad in China and is happy to engage in Chinese conversation. It follows that, though this advice might be practical, it's not objective. Hence the question, as it elicits non-objective advice, is opinion-based.
This question is not even suitable for Travel.SE. From their FAQ:
and it's not about …
asking for the 'best' thing to do (or similarly subjective questioning). Everyone is different. Detail what stuff you like to do/see if you're going down that route, so that we can better help you. Subjective questions are VERY likely to get closed.