By continuity of $f$, I understand that $f^{-1}X$ must be open in $Y$. Well, the statement is general, i.e. for any space $Y$. Don't know what's in it, don't know what topology it has.
Regardless, $f:Y \to X$ is continuous as long as $X=\{0,1\}$ has the indiscrete topology $\{\phi, X\}$. Why?
As mentioned we don't know what topology $Y$ has thereby, we don't know what sets are open closed or clopen or neither. So th pre-image $f^{-1}X$ has no means to be determined whether it is or isn't or neither open in $Y$ or not.
I mean, what if $f$ isn't injective and is constant, say it maps $f(y)=0 \in X$? But $0$ isn't open or closed to start with because $\{0\} \not\in \tau$. Then what? It makes no sense then to talk about whether the pre-image of open sets are open sets because $f$ isn't mapping any $y$ to an open set in $X$!
Confused, can someone tell me what is going on?