Incompleteness Theorem and Proof by Contradiction. Let me begin first by saying that I have no real background in formal logic, so this question may end up being an ignorant one.
I have recently been to a talk which concerned Godel's Incompleteness Theorems. The second theorem, to my understanding, states that consistent systems cannot prove their own consistency. Therefore, I think this implies that we cannot be certain of the consistency of our system of mathematics.
If this is the case, how is the method of proof by contradiction valid? More specifically, as inconsistencies have not been eliminated completely as a possibility, could it not be that the contradiction reached is a result of the axioms of mathematics being inconsistent, rather than the initial assumption being false?
I'm not sure whether the question is formulated sufficiently clearly, but it is nonetheless a conundrum that has been puzzling me of late. Any attention would be appreciated. Thank you in advance.
I have seen a similar question asked, but I do not think the answer provided completely answers my question, as it focuses more on provability rather than consistency.
 A: Let's look carefully at the situation where, in some formal system $S$, we have deduced a contradiction from an assumption $A$. There are two conclusions that people might want to reach in this situation: (1) $S$ proves "not $A$"; (2) $A$ is false.
Let's first look at (1). All the usual systems of propositional logic (not only classical logic but also intuitionistic logic) include the ability to infer "not $A$" from a proof of a contradiction under the assumption $A$. (In natural deduction systems, this ability amounts to the definition of negation. In Hilbert-style systems, this ability is more complicated, involving the deduction theorem.) So we get conclusion (1).
Now your objection is: What if $S$ is inconsistent and is "responsible" for the contradiction, while the assumption $A$ is an innocent by-stander? No problem, because an inconsistent formal system proves everything. In particular, if $S$ is inconsistent then it proves $A$. So conclusion (1) is still correct.
What about conclusion (2)? To get this conclusion (from a deduction of a contradiction using $S$ and $A$), we indeed need the consistency of $S$, as you suspected. In fact, we need more, namely that the system $S$ is sound, which means that any statement that $S$ can prove from true assumptions is itself true. Given soundness, we can use (1) and the fact that a contradiction is never true to conclude that $A$ is not true. So we get conclusion (2) if we know that $S$ is sound.
Knowing that a formal system $S$ is sound (or even the weaker fact that it's consistent) requires knowledge outside $S$ itself; that's the essence of the second incompleteness theorem.  For example, I know that ZFC is sound because all its axioms are true when interpreted in the cumulative hierarchy of all sets, but that argument cannot be carried out within ZFC.
[I should acknowledge, before someone else points it out, that I have ignored paraconsistent and relevantist formal systems and also formal systems that are too weak to interpret basic arithmetic. I've also said that we need soundness to get (2), but in fact it would suffice to have partial soundness --- soundness for a class of statements that contains $A$.  These points don't seem relevant to the question here, so it seems better to apologize here for ignoring them than to clutter the preceding paragraphs with enough caveats to make them true.]
