Affirm and confirm are two examples of transitive verbs, but they are not in any way referring to the same thing; in fact, both have different antonyms, synonyms. As a verb, affirm means to concur, verify, and to agree. In short, it means to answer positively. For instance, you can say: He affirmed that he would visit when I asked him. It also means supporting or encouraging. For example, My parents did all they could to affirm my self-confidence.
When passing judgments, the word 'affirm' is usually used to assert positively. For example, the Supreme Court affirmed the decision reached by the lower court. Confirm, on the other hand, means to strengthen something with proof to the point that it can never be disputed. For example, The DNA test confirmed that John is the real father. It can also be used to assure the accuracy or authenticity of a report.