It's always stressful to find out that you have a sexually transmitted disease, but finding out that you have an STD when you're married or in a long-term committed relationship can be particularly devastating. Not only do you have to deal with the diagnosis, you have to face the reality that your partner could be having an affair and face the consequences of infidelity. The only thing is that, sometimes, a cheating spouse isn't the issue at all.
In general, unless you've been reliable about your std screening and talking to your partner about testing it can be difficult to know who infected you with an std or when. Even if you had undergone regular screening, if you were infected while having sex with a partner who had not been tested in years, there is always the possibility that they were infected asymptomatically a long time before you got together - and just didn't know it. Even when you are having sex with someone who is infected with an std, you won't necessarily get infected the first time you sleep together. Particularly if you intermittently practice safe sex, it could take months or even years.
This issue often comes up when a person has a first herpes outbreak years into a marriage. Their first assumption is usually that they have a cheating spouse, and that may be true, but it's also possible that they had been infected for years but didn't realize it -- until something changed in their body that caused them to have their first noticeable symptoms. Similarly, when a married woman is diagnosed with pelvic inflammatory disease, she often thinks that her husband must have gotten whatever disease caused it from "the other woman," when, unless she was properly screened, it's also possible that she had been carrying around an infection from before they even met.
So what should you do if you find out if you have an std while you're in a long-term relationship with a committed partner? The first, and most important, thing is to ask your partner to get tested so that both of you can find treatment. Then, if your partner is also infected with the same std and therefore a possible source, you need to sit down and talk. The truth is that, unless both of you were tested before you had sex, it may be difficult to know who was infected first, and when that infection happened. Although most of the time the presence of symptoms points to a relatively recent infection, there are sometimes exceptions. If your partner insists that they weren't having an affair, and that there was no other woman or man, then you have to use your heart and your instincts to decide how you want to move forward into the future.
Remember though, if you want to stay with your partner but don't completely trust them, that safe sex is always an option. It's not a bad idea in any case. Condoms may not be infallible, but using them can give you some peace of mind.
Although there is sometimes a perception in American culture that condoms are something you "get past" once your relationship progresses far enough, there's actually no reason for that to be true. Many married couples use condoms for the life of their marriage, for both contraception and disease protection, without ever thinking about them as something that eventually they'll get to disregard. Unless you make it so, most of the time condom use just isn't that big of a deal.