Well I'll try and keep this as short as possible even though my story is quite long I'm afraid to say haha

I was with my ex for about 10 months. We had an argument one day based on absolutely nothing (I started it) And I broke up with him in anger. It was online aswell which annoyed me even more.
Over the next week we were talking about getting back together and working things out. Then one night, out of jealousy and curiosity, I logged onto his email account and saw and email of him exchanging numbers with a girl, which obviously drove me INSANEEE.
I confronted him about it in quite a bad way, I was unbelievably upset and angry because I though he'd asked another girl for her number whilst we were trying to work things out. Well after that he decided that he couldn't take the relationship anymore and he just needed time to himself (Which I can understand because I treated him badly at times and took him for granted) I did the usual begging and nothing worked. So we didn't speak for about 2 months. Then one day we emailed back and forth and exchanged new numbers, we ended up having a 4 hour conversation and everything was nice, he told me he still loved me and all the rest of it.
I visited him a few times after that and slept with him, which I know was wrong. I mentioned to him about getting back together and he said he would atleast think about it. So he did, and he came to the conclusion that we would date and see how it goes. No sex, just straight dating and hanging out. We did that a few times and everything was great. He then saw me 'flirting' with someone on my facebook page (Was just friendly banter) and he got jealous and obviously hated it. After another few arguments he decided he just couldn't do it anymore and wanted to remain friends. So now I'm back to the beginning. Honestly we had an amazing relationship and he was the most amazing boyfriend I could of asked for. I took him for granted and treated him badly at times and it got to him. I know he's in love with me because I can just see it when we're together. He claims he doesn't want a relationship right now because of his studies and all the stress but maybe a few months or years down the line he thinks we could work it out.
He say's I'm the one he could see himself marrying and mothering his children, he just needs some time to himself. He's even broke down in tears infront of me because he's so confused.
Now we're both kind of playing games with each other and trying to act like we're just 'friends' but it's not working out to great.
What should I do? -_-
Btw, there was a pregnancy involved also but ended in miscarriage and it really affected him.
It's also been over 4 months since we officially split and I've realised my faults and all what went wrong with the relationship.
I can honestly say the break up helped me alot and made me realise where I was going wrong. But still I love him far too much just to let him go.