Continuous in subspace topology Suppose $X = \lbrace 1,2,3,4,5 \rbrace$ and $\tau = \lbrace X, \emptyset , \lbrace 1 \rbrace , \lbrace 1,2 \rbrace , \lbrace 1,3,4 \rbrace , \lbrace 1,2,3,4 \rbrace , \lbrace 1,2,5 \rbrace \rbrace$. 
For $\tau_{M}$ we take subspace topology on $M = \lbrace 1,3,5 \rbrace$. 
We consider the function $f: X \rightarrow \lbrace 0,1 \rbrace$, where 
$$f(n) = \left\{ \begin{array}{ll}
0 & \textrm{if $n \le 3$}\\
1 & \textrm{others }\\
\end{array} \right.
$$
Let $f \mid_{M} : M \rightarrow \lbrace 0,1 \rbrace$ be the restriction of $f$ to $(M, \tau_{M})$.
Show that these function $f$ and $f \mid_{M}$ are continuous. If not, point the counterexample.
What I did? I think, that $\tau_{M} = \lbrace \lbrace 1,3,5 \rbrace , \emptyset , \lbrace 1 \rbrace  \rbrace$. But,  have no idea, what can I do next. Please, help me :)
 A: Assuming $\{0,1\}$ has the discrete topology:
For $f$ to be continuous, $f^{-1}[\{0\}]$ has to be open (as $\{0\}$ is open in $\{0,1\}$) and that set equals $\{n: n \le 3\} = \{1,2,3\} \notin \tau$, so $f$ is not continuous. $\tau_M = \{\emptyset, M, \{1\}, \{1,3\}, \{1,5\}\}$ not what you said, we take the intersection with $M$ with every subset in $\tau$.
And $f|M$ is the function that sends $1,3$ to $0$ again (which now do form an open set) and $5$ to $1$, so $(f\restriction_M)^{-1}[\{1\}]= \{5\} \notin \tau_M$ so again we have found an inverse image of an open set that is not open in the domain. 
A: You have $\tau_{M} = \lbrace \lbrace 1,3,5 \rbrace , \emptyset , \lbrace 1 \rbrace  \rbrace$. You missed $\{1,3\}$ and $\{1,5\}$.
$(f \mid_{M})^{-1}(0) = \{1,3\}$ an open set & $(f \mid_{M})^{-1}(1) = \{5\}$ not an open set. So $f \mid_{M}$ is not continuous.
A: Hint:
For continuity, the inverse image of any open set must be open.
Also, there are more sets in $\tau_M$.  Any intersection of an elementt of $\tau$ with $M$ is open.
I just noticed that the problem is incomplete: no topology was specified on the range space.  If you take the trivial topology, then every function is continuous.  Otherwise you need to check the preimage of each open set.
