Two events \( A \) and \( B \) are independent if and only if \( P(A \cap B) = P(A)P(B) \).
We know the formula for conditional probability: \( P(A | B) = \frac{P(A \cap B)}{P(B)} \) (provided \( P(B)>0 \)).
If \( A \) and \( B \) are independent, then \( P(A | B) = \frac{P(A)P(B)}{P(B)} = P(A) \).
Similarly, for the complement of \( B \), denoted by \( B^c \), we have \( P(A | B^c) = \frac{P(A \cap B^c)}{P(B^c)} \) (provided \( P(B^c)>0 \)).
If \( A \) and \( B \) are independent, then \( A \) and \( B^c \) are also independent, which means \( P(A \cap B^c) = P(A)P(B^c) \).
Therefore, \( P(A | B^c) = \frac{P(A)P(B^c)}{P(B^c)} = P(A) \).
From the above, if \( A \) and \( B \) are independent, then \( P(A | B) = P(A) \) and \( P(A | B^c) = P(A) \).
Thus, \( P(A | B) = P(A | B^c) \).
Conversely, if \( P(A | B) = P(A | B^c) \), and assuming \( 0<P(B)<1 \),
\( \frac{P(A \cap B)}{P(B)} = \frac{P(A \cap B^c)}{P(B^c)} \)
\( P(A \cap B) P(B^c) = P(A \cap B^c) P(B) \)
\( P(A \cap B) (1 - P(B)) = (P(A) - P(A \cap B)) P(B) \)
\( P(A \cap B) - P(A \cap B) P(B) = P(A) P(B) - P(A \cap B) P(B) \)
\( P(A \cap B) = P(A) P(B) \)
This shows that \( A \) and \( B \) are independent.