Spivak chapter 3 exercise 9 
I figured out part a, but I'm still confused on parts b and c. I don't understand how the function $f(x)$ assigns the values 0 or 1 for each $x$.
 A: (a)
$$
\begin{align}
C_{A\cup B}&= \max(C_A,C_B)=C_A+C_B - C_{A\cap B}\\
C_{A\cap B}&=\min(C_{A},C_B)=C_A\cdot C_B\\
C_{\mathbb{R}^n\setminus A}&= 1 -C_A
\end{align}
$$
(b) Define $A=\{x\in\mathbb{R}^n: f(x)=1\}$. Then $C_A=f$
(c) $f^2=f$ implies that for any $x\in\mathbb{R}^n$, $f(x)(f(x)-1)=0$, that is, either $f(x)=1$ or $f(x)=0$. Use part (b) now.
I leave the details to the the OP
A: What do you mean by you don't understand how $f(x)$ is $0$ or $1$ for all $x$? $f$ is just a function with that property, that's it. For $(\textrm b)$ you can take the following set:
$$A = \{x : f(x) = 1\}.$$
Yes, I know this is like cheating but notice that "$x$ in $A$" means that "$f(x)=1$" and "$x$ not in $A$" means that "$f(x)=0$" since $f(x)$ only takes the values $0$ and $1$. So $f = C_A$.
For the last part, recall that $f^2$ is the function such that $f^2(x) = f(x)^2$ for all $x$, so, $f=f^2$ means that $f(x) = f(x)^2$ for all $x$, that is, $f(x)[1-f(x)]=0$ for all $x$, i.e. $f(x)$ only can be $0$ or $1$.
