Hello Soloist123,
welcome to PC. I hope you will find some solace here

I am very sorry that you are going through such a painful and confusing situation. It is entirely understandable that you feel like you can hardly think straight at the moment. I think this will pass in time. Your brain is likely overwhelmed by all of the intense emotions. Try to remember that all feelings are temporary. You will not feel so confused and hurt forever.
Would you be willing to talk with a therapist? I think that could be really valuable for you right now...to get some comfort, professional insight, and coping strategies. I have found therapy really helpful at several points in my life when I felt confused or hurt or scared.
I think Skeezyks made some valuable points. Please don't pressure yourself to have this all figured out or a decision made soon. You are dealing with a complicated and very emotional situation. I think you need time to think things over. I also think that focusing on the 'why' may not be helpful for you. OpenEyes made some very valid points about sex and infidelity. I have known quite a few couples who struggled with issues similar to yours. It is more common than you may know...including among good people who never meant to hurt anyone. I am not saying that to negate your pain. Of course you feel hurt and sad. It's just that we humans are a messy bunch. We are far from perfect therefore our relationships are also imperfect. We all make mistakes. Sometimes those mistakes have nothing to do with sex. Sometimes they do.
I agree with Open Eyes that a man (or even a woman) could have sex with someone else without necessarily feeling attached to the new person. Sex and love are two different things. Yes, a person can be very much in love with a sexual partner. But it's also possible for sex to occur without any love at all. Not everyone feels that way. Some people never experience that but others do. Sexuality is so complicated and...well...different for each individual. The reason I break that down is because you don't have to immediately assume that your partner of 4 years does not care about you at all because he had sex with someone else. Confusing? Yes. Hurtful? No doubt. Was he trying to hurt you? I don't know him but based on what you described, maybe not. I believe that most people have good intentions...they aren't getting up everyday trying to inflict pain on others but they do make mistakes.
And of course the potential pregnancy with the other woman adds another painful edge to the scenario but I would assume that was not planned by either party. If you take a look at the research or consult with an experienced relationship therapist, you will see that infidelity often occurs when there were already significant problems in the relationship. Is that an excuse or justification? Not at all. But I think it is helpful to know. I think you mentioned that you and your partner were going through some issues and taking time apart. Do I have that right?
You asked where you go from here? I recommend starting with self-care. What brings you comfort when you are stressed? Are you taking care of your physical health? Do you have a friend who can listen calmly and kindly support you without judging or jumping to rash conclusions? Sometimes family members or girlfriends can unwittingly add more stress to this type of situation by adding their own personal histories and judgments. Even if you have a calm friend to chat with, I still think a therapist could really help. Try to think of this in terms of a path you are working along (regardless of the choice you make) with time rather than something which must be immediately accepted or rejected. Does that make sense? When we make major decisions based on raw emotion right after very painful news, we don't always make the decisions we later wished we had.
What's the best decision for you right now? I cannot say. I am not you. I don't walk around in your shoes all day. If I tried to steer you one way or the other, you are the one who would live with the consequences of the decision therefore I don't think it would be fair on you for me to do that. In time, you are the best person to decide for yourself. I can tell you that I experienced an unfaithful partner and I know how uniquely painful that is.
I will send you peace and healing energy as you go through this. And I am willing to read any other thoughts you may wish to share. Breathe slowly and deeply. Take good care of yourself. I hope things will likely become less confusing in time.