Suppose that $f:X\longrightarrow Y$ is continuous. Prove that if $W$ is an open subset of $Y$ then the set $\{x\in X: f(x)\in W\}$ is an open subset of $X$.
$\textbf{Proof:}$ Assume $f:X\longrightarrow Y$ is continuous and let $W\subset Y$ be open.
Consider the set $G=\{x\in X: f(x)\in W\}$.
If $G=\emptyset$ then $G$ is clearly open in $X$ and we are done.
Otherwise let $G\neq\emptyset$ and consider $x\in G$.
Since $f:X\longrightarrow Y$ is continuous and $f(x)\in W$, $W$ is open.
Thus $f^{-1}(W)$ is open in $X$.
Hence $G=f^{-1}(W)\in X$.
Then $G\subset X$.
Thus $G$ is an open subset in $X$.
Therefore if $f:X\longrightarrow Y$ is continuous and $W$ is an open subset of $Y$, then the set $\{x\in X: f(x)\in W$ is an open subset of $X$.
Just wondering if I did this right or if I can improve on something. Please let me know of any mistakes or clarifications that I need to make. Thanks.
It's not correct. $G=f^{-1}(W)$ so when you say "Thus $f^{-1}(W)$ is open in $X$", you didn't give any proof of this assertion! Moreover, this assertion is exactly... what you're asked to prove!
To prove it, you need to apply the definitions of continuity and openness. It depends on the spaces that you consider: as said in the comments above, if you use general topological spaces, then it follows directly from the definitions. Otherwise, you must tell us if you deal with metric spaces or...