Algebraic numbers and algebraic functions If $f : \bar{\mathbb{Q}} \to \mathbb{Q}$ is a continuous function, where $\bar{\mathbb{Q}}$ denotes the set of algebraic numbers, does such function have to be constant?
 A: The claim is actually false. Proffering the following counterexample
$$f(x)=\begin{cases}1,&\ \text{if the real part of $x$ is greater than $\pi$, and}\\
0,&\ \text{otherwise.}\end{cases}$$
A: 
can such function be constant?

I assume you mean "does it have to be constant?". No, it doesn't.

Lemma. There is a non-constant continuous function $f:X\to Y$ between any countable metrizable space $X$ with at least two points and any topological space $Y$ with at least two points.

Proof. If $X$ has an isolated point, say $x_0$, then we can simply glue any value on $\{x_0\}$ with any other constant value on $X\backslash\{x_0\}$. The "glueing" is done via pasting lemma.
If $X$ does not have an isolated point then by the famous Sierpiński theorem $X$ is homeomorphic to the standard $\mathbb{Q}$, and thus there is a non-constant continuous function to $Y$ because we can partition $\mathbb{Q}$ into two disjoint closed subsets and again apply the pasting lemma on constant pieces. $\Box$
So assuming you deal with the standard $\overline{\mathbb{Q}}$, which is a countable subspace of complex numbers (and thus metric), then the answer is that there are such non-constant continuous functions.
Of course the Sierpiński theorem I used is highly non-trivial, but on the other hand it covers a very wide range of cases.
