“I am 23 married and pregnant by another man. I havent seen or spoken to my husband in about 5 months. My question is, is the child considered a product of this marriage? Does the child get to keep her fathers last name which is not my husband or will she be given my husbands last name?”

If you do nothing, then the name that will be entered on the birth certificate will be your husband’s and he’ll get his last name. You could start a paternity action before your child is born to make sure that the real father is listed on the birth certificate. If you birth your baby at a hospital, you can swear out an affadavit that the putative father is the father as long as he’ll go along with it that he is the father, and your husband will go along with it that he is not the father.