An intriguing recursion

As stated in the comments there is a closed form for $x(k)$ and hence $y(k)$, $g(a,b)$ etc. We have the solutions $$x(k)=\frac{(b-2)a^k+a^{k+1}+a^{k-1}-abk+b(k-1)}{(a-1)^2}$$ $$y(k)=-1+\frac{b-2+a+a^{-1}-a^{1-k}bk+a^{-k}b(k-1)}{(a-1)^2}$$ Hence as $k\to\infty$ we have that $$g(a,b)=-1+\frac{b-2+a+a^{-1}}{(a-1)^2}=\frac{b}{(a - 1)^2}+\frac1a-1$$ $$f(a,b)=\frac1{(a - 1)^2}+\frac1{ab}-\frac1b$$ So clearly when $a,b\in\mathbb{Q}$ we have that $g(a,b)$ and $f(a,b)$ are rational.


Mathematica yields $x(k)= \dfrac{(b-2) a^{k+1}+a^{k+2}+a^k-a^2 b k+a b (k-1)}{(a-1)^2 a}.$ The relevant command is RSolve[{x[k+1]==a x[k]+b k,x[1]==1},x[k],k]. It follows that $$y(k)=\frac{a^{-k-1} \left((b-2) a^{k+1}+a^{k+2}+a^k-a^2 b k+a b (k-1)\right)}{(a-1)^2}-1. $$ From here, you can calculate $$g(a,b)=\lim_{k\to\infty}y(k)=\text{ConditionalExpression}\left[\frac{a^2+a (b-2)+1}{(a-1)^2 a}-1,\left(\frac{1}{(a-1)^2}|b|a\right)\in \mathbb{R}\land \ln (a)>0\right]. $$ Then you have $$f(a)=\frac{g(a,b)}{b}=\text{ConditionalExpression}\left[\frac{\frac{a^2+a (b-2)+1}{(a-1)^2 a}-1}{b},\left(\frac{1}{(a-1)^2}|b|a\right)\in \mathbb{R}\land \log (a)>0\right]. $$ From here, you can see that if the conditions are true, then if $a$ and $b$ are rational, $f(a)$ will certainly be rational, unfortunately.