I just wonder if my following solution is true.
Let $X,Y$ be sets, let $f:X\to Y$ be a function, let $\{Y_i\}_{i\in I}$ be a family of subsets of $Y$. (Note: I use equalities instead of mutual containment)
$$\begin{align}f^{-1}\left[\bigcup_{i\in I} Y_i\right] &= \{x \in X: \mbox{there exists an}\quad i \in I\mbox{ such that } y \in Y_i,f(x)=y\} \\&=\bigcup_{i \in I} f^{-1}\left[Y_i\right] \end{align}$$
I initially do not know how to get from the left to right, but when I put both sets in set notation, they turn out to be the same, hence the one line proof. Something go ultimately wrong?