Since $f$ takes only two values, the inverse image if an open (or in fact any) subset of $Y$ is either $\emptyset$ or $[0,\frac12]$ or $(\frac12,1]$ or $X$. Show that each of these sets is semi-open in $X$ according to definition 1.
Since $f$ takes only two values, the inverse image if an open (or in fact any) subset of $Y$ is either $\emptyset$ or $[0,\frac12]$ or $(\frac12,1]$ or $X$. Show that each of these sets is semi-open in $X$ according to definition 1.