I am really puzzled by this statement and it has so many different versions in different places. Yesterday I did a homework to prove that a finite function $f$ is continuous if and only if ${f^{ - 1}}(G)$ is open for any open set $G$. Today I see an application of this statement without the restriction of "finite". And I found in a lecture note which says

I am really confused. I want to know if this statement "a map $f$ is continuous if and only if for any open set $G$, ${f^{ - 1}}(G)$ is still open" is true in general? There is no need to impose a restriction like "finite map"? Can you provide a proof or a reference of proof? Thank you!