Teaching classmates who don't put much effort in I'm not sure where to ask this so I thought I'd ask you here.

I'm in my 3rd year at university doing maths and some of the modules are a bit tricky. I know this and I know the way that I need to work in order to understand the material and pass the exams well. Due to this, I try and spend  a lot of time learning the theory (and recently its been through loads of questions on here). However, what I noticed with some of my friends is that they don't put in the same amount of effort as me (quality wise).

Let's take the example on semidirect products. A lot of us have been struggling with constructing SDP's, however I've tried very hard to learn the theory on them and what the answer's are looking for and what the methods I need to do (and why I'm doing them) to try and learn how to construct them. A lot of that has been on Math.SE but I've been referring to online PDF's and lecture notes as well. Now, my friends know that I put this in and try and learn it and so I can do the work properly, so I think they're trying to take advantage of that. 

Today I showed one person how to do a question regarding compositions on Möbius transforms and they just refused to think for themselves. I said "think about it, because I'm not going to tell you what the answer is" and they still wouldn't think (just kept saying "I don't know"), so I didn't tell them the answer. Eventually, after some BIG hints, they got what to do. Now I've noticed people are relying on me to tell them how to construct SDP's (as this is a main question in the exam). From my history, you can see that I've struggled a lot with this and I think I'm close to solving this problem now, but at the same time I can tell that my friends aren't going to learn it themselves. Mentally they've given up and so won't even bother learning it. 

My question is this: Should I tell them the answer, when (it is when and not if because I WILL get it!) I figure out how to do it?

I feel bad because obviously I don't want to lie and say "I don't know how to do it" or mess up their exam, but at the same time, I feel like they had the exact same time as me to do this, and the same resources (online, books, notes, ask the lecturer, etc.) yet they still didn't do it. So it's their own fault. Plus, the time it'd take me to teach and explain it to them, I could spend that couple of hours doing my own work. Other examples, revise another module, etc.

What should I do? Do you academics have any tips?

I'm sure you feel like this sometimes when people ask questions on here clearly without thinking about and just expect you to answer it.
In my experience, undergraduate students are a lot like children. They will be as lazy as you allow them to be. They will resist learning. They will resist doing the work and putting in the time. It's human nature...and it is something we, as teachers, must get the students to change.

Were I in your shoes, I would make it clear how to do something (as any teacher should) but I would certainly NOT do the work for them. If they keep saying "I don't know" then you should tell them "It's OK. Not everybody gets it their first time. Perhaps you get it when you take this class for a second time." I usually see my students' eyes open a bit on this one as they see that you are being so compassionate and understanding while still being refused to be manipulated. They also get the clear understanding that they will fail if they don't do the work.

We need to help students. That includes helping them to not be so lazy.