Let $f(0,5)\to\mathbb R-\mathbb Q$ be a continuous function such that $f(2)=\pi$, then $f(\pi)=\pi$. True/False? 
Let $f(0,5)\to\mathbb R-\mathbb Q$ be a continuous function such that $f(2)=\pi$, then $f(\pi)=\pi$. True/False?

The answer given is True.
I think we can prove this by taking a constant function as well. Is that correct?
Does the given domain and range have anything to do here?
 A: Since the range is only irrational numbers, that means the output values would come after a jump (omitting rational numbers). But that would contradict the given statement that the function is continuous. It means the function is always giving the same value, in this case $\pi$. And this holds for the given interval $(0,5)$. Since $x=3.14...$ lies in this interval. So, $f(\pi)=\pi$.
A: A continuous function maps connected sets to connected sets. Thus the image of $f$ must be a connected subset of $X=\mathbb{R}\setminus\mathbb{Q}$. On the other hand, a subset of $X$ having at least two points is disconnected.
Let $S\subseteq X$, with $a,b\in S$ and $a<b$. Then take $r\in\mathbb{Q}$ such that $a<r<b$ and consider
$$
A=\{x\in S:x<r\},\qquad B=\{x\in S:x>r\}
$$
Can you prove that these sets show $S$ is disconnected?
A: Case I: Let $f(x)$ be a constant function in the given interval. If $f(2)=\pi\implies f(\pi)=\pi$
Case II: Let $f(x)$ not be a constant function.

*

*A) Let $f(\pi)\gt f(2)$. And let $s$ be a number with $f(2)\lt s\lt f(\pi)$
Applying Intermediate Value Theorem on the interval $[2,\pi]$, we can get some $c\in(2,\pi)$ such that $f(c)=s$
Now whatever the value of $f(\pi)$ is, we can get infinite $s\in\mathbb Q\implies f(c)\in\mathbb Q$, which is a contradiction.

*

*B) Same holds for $f(\pi)\lt f(2)$
Hence, $f(x)$ can't be other than a constant function.
