It's not a matter of being right vs. solving the problem. Usually things are a tiny bit more complicated than that. Thing is you do have the choice in any argument to ask yourself whether it matters to you that you are right more than it matters to you that you are happy. If you decide that you don't want to waste a long time of your day having that argument and then feeling like shit for the rest of the day regardless of if were right or wrong, then you can just decide to leave. Of course, that does not in any way mean that you have the right to be an ass and just ignore them when they want to talk to you. Although I really enjoy a nice, quiet and peaceful time, I also do enjoy debating, and sometimes even start finding myself bitching about random shit, (I want to apologize to @CodyJProductions and everyone else I spent some time with on this server that had to go through my bullshit).
With that said, I think you should always remember if an argument is meaningful in any way to you (most of the times it's not) and act accordingly.