I got a very bad review from one reviewer, but the paper was not rejected Some time ago, I submitted my paper to a reputable journal (but far from being one of the best in my field) and have recently received two reviews. One review was positive overall and the reviewer recommened to accept my paper. On the other hand, the second reviewer was very critical of my work. The reviewer explained, in great details, why everything was wrong with my paper (even including the notation I use) and why such research is absolutely pointless and irrelevant. Moreover, the reviewer also criticized my other publications, implied that my research is way below the international level, and recommened to reject the paper. Despite such a bad review, the editor did not reject my paper and asked me to provide a revision without any additional comments.
To be entirely honest, I would've preferred my paper to be rejected after such a review, because I think that no revision can change the second reviewer's opinion about it. In addition, I do not really know how to revise my paper. I can change the notation and rewrite some parts of it in response to some of the comments, but I cannot change the topic of my research to make it relevant in the eyes of the second reviewer.
What would you do in my situation? I'm thinking about writing an e-mail to the editor in order to ask their opinion about the situation and what they would consider as a proper revision of my paper.
Since

the editor did not reject my paper and asked me to provide a revision

you can revise the paper and resubmit with a fair chance that it will be accepted. Respond to all the comments in the favorable review, either by changing something or explaining in your cover letter why you didn't.
Try to put the  tone of the unfavorable review aside so that you can decide whether addressing  any of the comments there will in fact improve your paper.
You could write the editor in advance to ask if this is a reasonable strategy. You don't have to withdraw just because one reviewer was unprofessionally nasty.