Wanted to make sure I have all the technical details in the following argument correct

Let $\displaystyle (X_1,T_1)$ and $\displaystyle (X_2,T_2)$ be topological spaces and $\displaystyle f:X_1\rightarrow{X_2}$ be a bijection. Prove that $\displaystyle f$ is a homeomorphism if and only if $\displaystyle f(T_1)=T_2$

Proof

Let $\displaystyle f$ be a homeomorphism. Consider $\displaystyle U\subset{X_1}$ and let $\displaystyle f(U)\in{T_2}$. $\displaystyle f(U)$ is open, and $\displaystyle f$ is continuous, so $\displaystyle U$ is open, so $\displaystyle U\in{T_1}$

And let $\displaystyle U\in{T_1}$, $\displaystyle f(U)\subset{X_2}$, $\displaystyle U$ is open and $\displaystyle f^{-1}$ is continuous, so $\displaystyle f(U)$ is open and $\displaystyle f(U)\in{T_2}$

Now let $\displaystyle f(T_1)=T_2$, so if $\displaystyle U\in{T_1}$, then $\displaystyle f(U)\in{T_2}$, so both are open so $\displaystyle f^{-1}$ is continuous and when $\displaystyle f(U)\in{T_2}$, then $\displaystyle U\in{T_1}$ so $\displaystyle f$ is continuous, thus a homeomorphism.

QED

Are all the details in the proof correct?