Continuous functions in topological spaces and neighborhoods I'd like to ask for verification of my understanding, concerning this remark that $U$ and $V$ are open neighborhoods: if we use the definition of continuous functions between topological spaces as the criterion to show that $U$ and $V$ are open, it is then implied that sets of the form [a,b) and (c,d] are open in [0,1]. I get that this is the case if [0,1] is regarded as a subset of $R^2$, but it's not if [0,1] is considered the whole space. What am I missing here?
Also, is it true that $U$ and $V$ are disjoint because otherwise, there exists $x \in U \cap V$ that is mapped by $f$ to both $[0,1/4)$ and $(3/4,1]$, which is a contradiction?

 A: First we should be comfortable with the fact that the subspace topology on $[0,1]$ inherited from $\mathbb{R}$ is a valid topology in and of itself. So we verify that following is actually a Topology:
$$ \mathcal{T}=\{[0,1]\cap U \,\, | \,\, U \mbox{ open in } \mathbb{R}\} $$
Note that we can define this independent of $\mathbb{R}$ as 

$$ \mathcal{T} = \{\emptyset,[0,1] \} \cup \{ U\subseteq [0,1] \mbox{ such that } $$ $$  U \mbox{ is is made of countable unions and  finite intersections of sets of the form } [0,a),(b,1] \mbox{ and } (c,d)$$

so it really is a topology on the space $[0,1]$
Indeed this is a topology including all unions and intersections of open sub-intervals of $[0,1]$, along with $\emptyset$, $[0,1]$, and elements of the form $[0,a)$ and $(b,1]$.  Now it might not be the topology you expected (since $[0,1/4)$ doesn't seem open to you), but it is a valid topology by definition
Remember that a topology is a description of what sets are "open" in a given space.  Therefore two topologies on the same space can be completely different but both valid.  it just so happens that the subspace topology in this case is different than the topology you are used to
To answer your question about $U$ and $V$, you are correct.  If $U\cap V \neq\emptyset$, then their intersection contains an element $x$, meaning $f(x)$ is in both intervals and hence $f(x) < 1/4 < 3/4<f(x)$
A: It is not specified in the question, but $X$ should be some topological space.
A general property of any map $f\colon X\to Y$ is that, for $A,B\subseteq Y$,
$$
f^{-1}(A\cap B)=f^{-1}(A)\cap f^{-1}(B)
$$
(prove it). In particular, with $Y=[0,1]$ and $A=\{0\}$, $B=\{1\}$, we have
$$
f^{-1}(\{0\})\cap f^{-1}(\{1\})=f^{-1}(\{0\}\cap\{1\})=f^{-1}(\emptyset)=\emptyset
$$
Similarly for $A=[0,1/4)$ and $B=(3/4,1]$.
Now the topological part. Here, although not explicitly said, $[0,1]$ is a topological space with the relative topology of $\mathbb{R}$. Since the space is Hausdorff, $\{0\}$ is a closed set, hence $f^{-1}(\{0\})$ is also a closed set by continuity; similarly for $f^{-1}(\{1\})$.
Since $(-1,1/4)\cap[0,1]=[0,1/4)$, we have that $[0,1/4)$ is open in $[0,1]$; hence its inverse image $f^{-1}\bigl([0,1/4)\bigr)$ is an open set in $X$ by continuity. Similarly for $(3/4,1]=(3/4,2)\cap[0,1]$.
Another way is to look at $f$ as a map $X\to\mathbb{R}$, which happens to have its range (image) contained in $[0,1]$. This map is likewise continuous, because the embedding map $i\colon[0,1]\to\mathbb{R}$ is continuous when the domain is given the relative topology; so we can consider, more properly, the map $g=i\circ f$. Since
$$
f^{-1}\bigl([0,1/4)\bigr)=g^{-1}\bigl((-1,1/4)\bigr)
$$
we have that this set is open as the inverse image of an open set by a continuous map.
