Find all continuously differentiable functions $ f: \mathbb{R}\to\mathbb{R}$ such that for every rational number $ q,$ the number $ f(q)$ is rational and has the same denominator as $ q.$ (The denominator of a rational number $ q$ is the unique positive integer $ b$ such that $ q\equal{}a/b$ for some integer $ a$ with $ \gcd(a,b)\equal{}1.$) (Note: $ \gcd$ means greatest common divisor.)
1. **Given Conditions and Initial Setup:**
   We are given that \( f: \mathbb{R} \to \mathbb{R} \) is a continuously differentiable function such that for every rational number \( q \), the number \( f(q) \) is rational and has the same denominator as \( q \). 

2. **Analyzing the Derivative:**
   Since \( f \) is continuously differentiable, \( f' \) is continuous. We need to show that \( f' \) is an integer. 

3. **Choosing Rational Points:**
   Pick an arbitrary \( x \in \mathbb{R} \) and let \( \epsilon > 0 \). By the continuity of \( f' \), there exists \( \delta > 0 \) such that if \( |x - y| < \delta \), then \( |f'(x) - f'(y)| < \epsilon \).

4. **Selecting Rational Numbers:**
   Choose rational numbers \( \frac{2m-1}{2^n} \) and \( \frac{2m+1}{2^n} \) such that \( x - \delta < \frac{2m-1}{2^n} < x < \frac{2m+1}{2^n} < x + \delta \).

5. **Applying the Mean Value Theorem:**
   By the Mean Value Theorem, there exists \( \zeta \) in the interval \( \left( \frac{2m-1}{2^n}, \frac{2m+1}{2^n} \right) \) such that:
   \[
   f'\left( \zeta \right) = \frac{f\left( \frac{2m+1}{2^n} \right) - f\left( \frac{2m-1}{2^n} \right)}{\frac{2m+1}{2^n} - \frac{2m-1}{2^n}}.
   \]

6. **Denominator Condition:**
   Since \( f \left( \frac{2m+1}{2^n} \right) \) and \( f \left( \frac{2m-1}{2^n} \right) \) are rational numbers with the same denominator \( 2^n \), the difference \( f \left( \frac{2m+1}{2^n} \right) - f \left( \frac{2m-1}{2^n} \right) \) is also a rational number with denominator \( 2^n \). Thus, \( f'(\zeta) \) must be an integer.

7. **Conclusion on \( f' \):**
   Since \( f'(\zeta) \) is an integer and \( f' \) is continuous, \( f' \) must be constant. Therefore, \( f'(x) = k \) for some integer \( k \).

8. **Form of \( f \):**
   Integrating \( f'(x) = k \), we get \( f(x) = kx + C \) for some constant \( C \).

9. **Determining \( C \):**
   To satisfy the condition that \( f(q) \) has the same denominator as \( q \) for any rational \( q \), we need to check specific values. For \( q = 0 \), \( f(0) = C \) must be an integer. For \( q = 1 \), \( f(1) = k + C \) must also be rational with the same denominator as 1, which implies \( k + C \) is an integer. Thus, \( k \) must be an integer.

10. **Final Form of \( f \):**
    Therefore, \( f(x) = kx + n \) where \( k \) and \( n \) are integers.

The final answer is \( \boxed{ f(x) = kx + n } \) where \( k \) and \( n \) are integers.