Is every function $f: C \rightarrow \mathbb{R}$ continuous? (C is Cantor set)? Is every function $f: C \rightarrow  \mathbb{R}$ continuous? (C is Cantor set) We assume that $ f [ C ] \neq \mathbb{R} $.
Continuous image of a compact space is compact and Cantor set is compact, because it is closed subset of [0,1] which is compact. 
$|C| = \mathfrak{c} =|(0,1)|$ so there exists a function $f$ s.t. $f[C]=(0,1)$. (0,1) is not compact, thus $f$ is not continuous. 
Is that correct?
Incorrect solution:
Let $f(0) = f(1) = 0 $ and $f(x) = 1, $ for $ x \notin \{0,1\} $. Then $ f^{-1}[\{1\}]= C \cap (0,1) $ which is an open set, thus f is not continuous.
 A: Claim 1: The relative topology on $C$ is not the discrete topology.
Proof of Claim 1: Prove by contradiction. Suppose that the relative
topology on $C$ is the discrete topology. For each $x\in C$, $\{x\}=C\cap U_x$
for some open set $U_x\subseteq\mathbb{R}$. Note that $C$ is compact and $\{U_x\mid x\in C\}$ is an open covering
for $C$, so there exists a finite subcover, denoted by $\{U_{x_{1}},U_{x_{2}},\ldots,U_{x_{n}}\}$.
Now 
$$
C=C\cap\bigcup_{k=1}^{n}U_{x_{k}}=\bigcup_{k=1}^{n}\left(C\cap U_{x_{k}}\right)=\{x_{1},x_{2},\ldots,x_{n}\}
$$
 which is a contradiction because $C$ is an infinite set (actually uncountable, but we do not need this fact).
Claim 2: The relative topology on $C$ is the discrete topology iff
each function $f:C\rightarrow\mathbb{R}$ that satisfies $f[C]\neq \mathbb{R}$ is continuous.
Proof of Claim 2: The $\Rightarrow$ direction is trivial and only
the $\Leftarrow$ needs a proof. Suppose that each function $f:C\rightarrow\mathbb{R}$ that satisfies $f[C]\neq \mathbb{R}$
is continuous. Let $a\in C$ be arbitrary. Define $f:C\rightarrow\mathbb{R}$
by 
$$
f(x)=\begin{cases}
x, & \mbox{ if }x\neq a\\
100, & \mbox{ if }x=a
\end{cases}.
$$ Clearly, $f[C]\neq \mathbb{R}$ and $(99,101)$ is an open subset of $\mathbb{R}$, hence $\{a\}=f^{-1}\left((99,101)\right)$
is an open subset of $C$. Therefore, the relative topology on $C$ is the discrete topology.
By Claim 1 and Claim 2, it follows that not all function $f:C\rightarrow\mathbb{R}$
are continuous.
