I love both groups. f(x) was one of my favorite groups when I first got into Kpop. They had fantastic title tracks as well as b-sides. Red Velvet, while I'm no fan of their work for the past few years, still remains as one of my favorite Kpop groups that are active today. Just like f(x), they have fantastic title tracks as well as b-sides. But if I had to break it down, I think I'd give the edge to Red Velvet when it comes to title tracks and f(x) when it comes to b-sides.
Overall, and I can already see a certain geriatric poster foaming at the mouth once he reads this, I think I like Red Velvet more. Both amazing groups though.