I'm currently working through Analysis by Tao and I just did an exercise but I'm not sure if it's correct. The question is
Let $f: X \to Y$ be a function from one set X to another set $Y$, and let $U, V$ be subsets of $Y.$ Show that $f^{−1}(U \cup V ) = f^{−1}(U) \cup f^{−1}(V)$
I have at the moment:
Proof: Let $x\in f^{−1}(U \cup V )$ therefore we have $f(x) \in U \cup V$. Therefore $f(x) \in U$ or $f(x) \in V$. We use cases. If $f(x) \in U$ then $x \in f^{-1}(U)$ and therefore we have $x \in f^{−1}(U) \subset f^{−1}(U) \cup f^{−1}(V )$. If $f(x)\in V,$ then $x\in f^{−1}(V)$. Thus, $x\in f^{−1}(V)\subset f^{−1}(U) \cup f^{−1}(V)$. In either case, we have that $x\in f^{−1}(U) ∪ f^{−1}(V).$
For the second subset inclusion, let $x \in f^{-1}(U) \cup f^{-1}(V)$. Thus, $(x \in f^{-1}(U))$ or $(x \in f^{-1}(V)),$ giving us two cases. In the first case, $x \in f^{-1}(U)$ and thus $x \in U$ So, $f(x) \in U \subset U \cup V$ and thus $f(x) \in U \cup V.$ This gives us that $(x \in f^{-1}(U \cup V) .$ In the second case, $x \in f^{-1}(V)$ and thus $f(x) \in V .$ So, $f(x) \in V \subset U \cup V$ and thus $f(x) \in U \cup V .$ This gives that $x \in f^{-1}(U \cup V).$ In either case, $x \in f^{-1}(U \cup V)$ and so we have the subset inclusion $f^{-1}(U) \cup f^{-1}(V) \subset f^{-1}(U \cup V).$ QED
Your proof is correct but you can make it shorter in the following way:
Let $x \in f^{-1}(U \cup V).$ Then $f(x) \in U \cup V.$ That is $$f(x) \in U \text{ or } f(x) \in V.$$ Therefore $$x \in f^{-1}(U) \cup \text{ or } x\in f^{-1}(V).$$ In other words $$x\in f^{-1}(U) \cup f^{-1}(V).$$ So we may conclude $f^{-1}(U \cup V) \subseteq f^{-1}(U) \cup f^{-1}(V).$
Similarly, for the converse, you can omit splitting into cases.