Real valued function which is continuous only on transcendental numbers First of all, I am sorry for asking this question.
We know that $R$ is uncountable. And also the set of all transcendental numbers is uncountable. 
How can I construct a function $f(x)$ on $R$ which is continuos only at transcendental numbers? Is it possible?
Thanks in advance. 
 A: You have had some strong hints. Here's an even stronger one.  Start with Thomae's function:
f(x) = 
\begin{cases}
\frac{1}{q},  & \text{if $x \in \mathbb{Q}$ and $x = \frac{p}{q} \land p \in \mathbb{Z} \land q \in \mathbb{N} \land p,q$ coprime} \\
0, & \text{if $x \notin \mathbb{Q}$}
\end{cases}
You need to understand why this works first.  The idea is for $\epsilon > 0$ there are only finitely many values of $q$ such that $\frac{1}{q} \geq \epsilon$.  
Now you need to add a case for the algebraic numbers.  
f(x) = 
\begin{cases}
\frac{1}{q},  & \text{if $x \in \mathbb{Q}$ and $x = \frac{p}{q} \land p \in \mathbb{Z} \land q \in \mathbb{N} \land p,q$ coprime} \\
?, & \text{if $x \notin \mathbb{Q} \land  x \in \mathbb{A}$} \\
0, & \text{if $x \notin \mathbb{A}$}
\end{cases}
So, you need a suitable value for that ?, what value will work for algebraic numbers?  You can use an idea similar the rationals.  First, remember what an algebraic number is: it is the root of a non-zero polynomial with rational coefficients.  Let $n$ be the lowest degree of any such polynomial.  Can you see how to use $n$ similarly to how $q$ is used for the rational case?
A: I think one can also proceed as follows:
Define the step function $\psi: \mathbb{R} \rightarrow \mathbb{R}$ by 
\begin{equation*}
\psi(x) = \begin{cases}
               1 \text{ if } x \geq 0\\
               0 \text{ otherwise}
          \end{cases}
\end{equation*}
Let $a_{1},a_{2},\dots$ be an enumeration of all algebraic integers and let 
\begin{equation*}
  f(x) = \sum_{n = 1}^{\infty}2^{-n}\psi(x-a_{n}).
\end{equation*}
