How to deal with a student who most likely has a mental condition, and keeps arguing with me in class?
I have responsibility for students with alternate needs within a Computer Science department and thus have professional experience of the situation you describe. It is not uncommon in our subject.

Our experience is that computing attracts a higher proportion of students on the Autistic Spectrum than do other disciplines. We are operating with about (my personal guess) 2-3% (of total cohort) diagnosed and perhaps double that number undiagnosed. 

Some of these students are often not aware of the rest of the class being present and treat teaching as a personal one-to-one dialogue with the teacher. They act as they would sitting with you across a desk. Sometimes it is more extreme and the social norms and boundaries of even working one-to-one are not clear to them. Although, as a spectrum condition, each person may be different, it is common that they wish to understand every point of minutiae before they can build the big picture understanding; becoming detailed obsessed is often a common trait. This leads to question after question as a form of quest.

You should seek advice from a more experienced professional in your institution. It is likely that the student's condition is known, but details are often considered confidential and perhaps not shared with you, because that is what the student may wish. The student may be receiving support elsewhere, perhaps in the form of mentoring. If that is the case then the mentor may be able to assist in explaining the social situation to the student and also give you guidance on how to reply.

Sometimes such students are not diagnosed with any specific condition and are not receiving support as it has never been needed. They are likely to have achieved high grades in earlier studies and the good results have propelled them through to your class.

For a student who is unaware that their behaviour is different from others in their class it is more difficult to handle. I ask such a student to speak to me in a one-to-one appointment in my office. I do not assume that they have any named condition, as this is not really relevant. I just talk to them to explain how lectures work, clarify my role and how I can answer questions. I often have to explain, sometimes in great detail, what makes a good verbal question in class, what makes a good verbal question, what makes a good written question for email, what makes a good question for the class VLE, what makes a good question for StackExchange and so on. It is often the case that no one has ever explained how information is obtained. It does take a degree of tact and experience to do this, which is why I suggested seeking more experienced advice.

Remember, some of the achievements in our subject have been made by people who others found difficult to work with. Look at the movie "The Imitation Game" and you can clearly see (in a fictionalised portrayal) Alan Turing is shown displaying tendencies similar to those you describe. I'm sure if you had a current student with similar attributes you would have been pleased to have had the opportunity to have someone so similarly gifted in your class.