Can we, $\forall\space x\in\mathbb{R}$, find a linear transformation of the form $ax+b$ where $a,b\in\mathbb{R}$ such that if $x\in\mathbb{R}$ \ {$\mathbb{Q}$}, then $(ax+b) \in\mathbb{Q}$ and if $x\in\mathbb{Q}$ then $(ax+b)\in\mathbb{Q}$.
So for example, find $a,b\in\mathbb{R}$ such that $(a\pi+b)\in\mathbb{Q}$ and $(an+b)\in\mathbb{Q}$ where $n\in\mathbb{Q}$.
The answer is no:
If $aq+b\in\mathbb Q$ for any $q\in\mathbb Q$, then $a=2a+b-(a+b)\in\mathbb Q$. So $b=(a+b)-a\in\mathbb Q$. This implies that if $x$ is irrational, then $ax+b$ cannot be rational, otherwise $x=\frac{ax+b-b}{a}$ would be rational.
Hope this helps.