Does this work for any $f$?
\begin{equation} \chi_{f^{-1}(A)}(i) = \begin{cases} 1, & \text{if $i \in f^{-1}(A)$} \\ 0, & \text{if $i \not\in f^{-1}(A)$} \end{cases} = \begin{cases} 1, & \text{if $f(i) \in A$} \\ 0, & \text{if $f(i) \not\in A$} \end{cases}= (\chi_{A} \circ f)(i) \end{equation}
Looks like it does. Hint: learn about Iverson brackets. They're handy for solving these problems.