Kiddushin 3:12-13
Kiddushin 3:12
Whenever a marriage is effective and violates no law, the offspring of the union takes the father’s status. An example of this is a woman from a kohein, Levi or Yisroel family who marries a kohein, a Levi or a Yisroel (the offspring follow the father). If a marriage is effective but it violates some law, the offspring takes the lesser status of the two parents. Examples include a widow who marries a Kohein Gadol, a divorcee or a woman who performed chalitzah who marries a regular kohein, a mamzeres or a Gibeonite woman who marries a regular Jew, or a regular Jewess who marries a mamzer or a Gibeonite man. If one cannot effectively marry a particular person but that person could effectively marry others, the offspring is a mamzer. This refers to all the forbidden (i.e., incestuous and adulterous) relationships in the Torah. If the other person cannot effect marriage with any Jew, then the offspring follow the mother. Examples include the children of a maidservant or a non-Jewish woman.
Kiddushin 3:13
Rabbi Tarfon says that a mamzer can purify his offspring as follows: if a mamzer marries his maidservant, his child will be a servant. If the father frees his son, he will become a regular Jew. Rabbi Eliezer disagrees on the basis that the son would be both a mamzer and a servant, not just a servant.