I am going to give a presentation about the indicator functions, and I am looking for some interesting examples to include. The examples can be even an overkill solution since I am mainly interested in demonstrating the creative ways of using it.
I would be grateful if you share your examples. The diversity of answers is appreciated.
To give you an idea, here are my own examples. Most of my examples are in probability and combinatorics so examples from other fields would be even better.
Calculating the expected value of a random variable using linearity of expectations. Most famously the number of fixed points in a random permutation.
Showing how $|A \Delta B| = |A|+|B|-2|A \cap B|$ and $(A-B)^2 = A^2+B^2-2AB$ are related.
An overkill proof for $\sum \deg(v) = 2|E|$.
Whether it's overkill is open to debate, but I feel that the inclusion-exclusion principle is best seen through the prism of indicator functions.
Basically, the classical formula is just what you get numerically from the (clear) identity: $$ 1 - 1_{\bigcup_{i=1}^n A_i} = 1_{\bigcap_{i=1}^n \overline A_i} = \prod_{i=1}^n (1-1_{A_i}) = \sum_{J \subseteq [\![ 1,n ]\!]} (-1)^{|J|} 1_{\bigcap_{j\in J} A_j}.$$