Saying "how are you doing?" does not make you responsible for how that person is actually doing. They would be having a bad day whether you asked or not. It is simply a common courtesy and not something you should be worrying about asking people. Most times if people do divulge that they are having a bad time then they usually are opening themselves up to speak about it, or at least receive a follow up question. If after that they say "I'd rather not talk about it" then the you simply drop it and go on with another conversation.