How does proof by contradiction work logically?
Normally in a proof we might have a true premise leading to a true conclusion, i.e. it is true that $T \rightarrow T$.
But then how does proof by contradiction work? We assume the premise is false and then the goal is to what, show $F \rightarrow F$? Or $F \rightarrow T$? (both of which are true?)
Like what exactly is the logical mechanism underneath all this that lets proofs work as well as proof by contradiction?
Yes, well, a proof by contradiction involves two rules of inference.
$$\begin{split}\text{Negation introduction}\quad&\quad (r\implies q) \text{ and } (r\implies \neg q), \text{ infers } \neg r\\\text{Double Negation elimination:}\quad &\quad \neg\neg p\text{ infers } p\end{split}$$
(1) the "Negation introduction" rule of inference argues that if something implies a contradiction then it must be false, since we usually assert that contradictions are not true and so cannot be infered by true things.
This is acceptable in both intuitionistic and classical logic systems. Although there are other systems (such as minimal logic) which do not accept this.
($\def\false{\mathsf F}\def\true{\mathsf T}$Semantically, this is because $\false \to \false$ is true while $\true\to\false$ is false. This leads some systems to define negation as $\neg \phi ~\equiv~ \phi\to\mathsf F$ .)
(2) the "Double negation elimination" rule is that if the negation of a premise is false, then the premise must be true. This is not accepted in intuitionistic logic, but it is in classical logic.
(3) Combining these rules give the schema for a proof by contradiction: assume a negation of a predicate, demonstrate that infers a contradiction, thereby deducing that the predicate is true.
$$\begin{split}\text{Proof by Contradiction}\quad&\quad (\neg p \implies q) \text{ and }(\neg p\implies \neg q) \text{, infers }p\end{split}$$