If $f: X \rightarrow Y$ is a bijection, then $f(U) = Y\setminus f(X \setminus U)$. I'm proving the compact-to-Hausdorff lemma (probably not a universal name for it) which is stated as:

If $X$ is compact, $Y$ Hausdorff, $f:X \rightarrow Y$ a continuous bijection, then $f$ is a homeomorphism.

However, the following line has popped up in a proof of it:

If $f: X \rightarrow Y$ is a bijection, then $f(U) = Y\setminus f(X \setminus U)$ (where $U$ is open in $X$)($\star$).

I know that if $f$ is a bijection, then $f(X\setminus U) = f(X) \setminus f(U)$. Using this, I've tried to draw a little picture to try to see that $f(U) = Y\setminus f(X \setminus U)$, but it hasn't actually helped.
What's a proof of ($\star$)?
 A: If $y\in f(U)$, then there exists $x\in U$ such that $f(x)=y$. Since $f$ is injective, there cannot be an element $z\in X\setminus U$ such that $f(z)=y$. Therefore $y\not\in f(X\setminus U)$, i.e. $y\in Y\setminus f(X\setminus U)$.
On the other hand, suppose that $y\in Y\setminus f(X\setminus U)$. There exists some $x\in X$ such that $f(x)=y$ because $f$ is surjective, and $x\not\in X\setminus U$ because $y\not\in f(X\setminus U)$, so $x\in U$. Therefore $y\in f(U)$.
A: My pleasure: 
How about $f(U) \cup f(X\setminus U) = f(U\cup (X\setminus U)) = f(X) = Y$? Since  $f(U)$ and $f(X\setminus U)$ are disjoint, you get $f(U) = (f(U) \cup f(X\setminus U))\setminus f(X\setminus U) = Y\setminus f(X\setminus U)$.
A: $Y\setminus f(X\setminus U)=Y\setminus (f(X)\setminus f(U))=^*(Y\setminus f(X)) \cup (f(U)\cap f(X)\cap Y)=\emptyset \cup f(U)$
where the last equality holds because of bijectivity
$*$ holds because the elements in $f(U)\cap f(X) \cap Y$ are precisely the elements which are in $f(U) \cap f(X)$ so they are wrongfully removed from $Y$ before. So we need to add those being in $Y$ again which makes it $f(U)\cap f(X) \cap Y$
A: The property you want to prove is the same as
$$
Y\setminus f(U)=f(X\setminus U)
$$
Suppose $y\notin f(U)$; then $f^{-1}(y)\notin U$ and therefore $f^{-1}(y)\in X\setminus U$. Therefore $y\in f(X\setminus U)$.
Similarly for the converse inclusion.

Note that, in general, when you have a function $g\colon A\to B$, then for every subset $C$ of $B$ we have
$$
g^{-1}(B\setminus C)=A\setminus g^{-1}(C)
$$
(where $g$ need not be bijective: $g^{-1}(C)=\{a\in A:g(a)\in C\}$; in order to avoid confusions, I usually write $g^{\gets}(C)$, instead, but $g^{-1}(C)$ is commonly used).
Your case is exactly this one, with $g=f^{-1}$.
