We know a real number $\sqrt[k]{n}$ (for integer $k >1$ and integer $n$) is irrational unless $n$ is a perfect $k$ power.
We can conclude then if $\frac nm$ is fraction of coprime integers. that $\sqrt[k]{\frac nm}$ is irrational unless both $n$ and $m$ are both perfect $k$ powers.
(Pf: $\sqrt[k]{\frac nm} = \frac ab$ with $a,b$ coprime then
($a^km = b^kn$ and so assume $p$ is a prime factor of $n$. Then $p|a^km$ but $p\not \mid m$ so $pa^k$ so $p|a$ so $p\not \mid b$. The power to with $p$ divides $a^k$ is a multiple of $k$ so the power to which $p|n$ is a multiple of $k$. That is true of all prime factors so $n$ is a perfect $k$ power. [Or if $n$ has no prime factors which can only occur if $n=\pm 1$ which is a trivial perfect $k$ power. {$k$ must be odd if $\frac nm < 0$}]. Identical argument shows that $m$ is a perfect $k$ power.)
Okay, so if $r = \frac ab$ and $a,b$ are coprime integers with $b$ positive then
$r^r = \frac {\sqrt[b]{a^a}}{\sqrt[b]{b^a}}$. This is only rational if both $a^a$ and $b^a$ are perfect $b$ powers. As $\gcd(a,b) =1$, the only way any $k^a$ can be a perfect $b$ power is if $k$ is a perfect $b$ power.
So for this to be rational there must exist $j,k$ so that $b = j^b$ and $a=k^b$.
But $b = j^b$ is ... fishy.
Claim: If $j\ge 2$ then for any natural $n$, $j^n > n$.
Pf: simple by induction. ($j^1 =j> 1;$ and if $j^n> n$ then $j^{n+1} > j*n \ge 2*n = n+ n \ge n+1$.)
So $j=1$ and $b=1$.
Thus the only way for $r^r$ to be rational, for a rational $r$, is for $r= \frac a1 = a\in \mathbb Z$.
Obviously for integer $a$ we have $a^a$ is also an integer. But if $r$ is a non-integer rational then $r^r$ is irrational.
Consider the unique power series in $\,t\,$ that satisfies
$$ f(t,q) = \sqrt{1 + tf(t\,q,q)}. \tag{1} $$
We can express it as a continued square root
$$ f(t,q) = \sqrt{1 + t\sqrt{1 + t\,q\sqrt{1 +
t\,q^2 \cdots}}}. \tag{2} $$
The first few terms are
$$ f(t,q) \!=\! 1 \!+\! (1/2)\,t^2 \!+\!
(-1/8\!+\!1/4q)\,t^3 \!+\! \\
(1/16q\!-\!1/8q\!-\!1/16q^2\!+\!1/8q^3)\,t^4
\!+ \cdots .\tag{3} $$
A special case closed form formula is
$$ f(1/2^n,1/2)=1+2^{-(n+1)}, \tag{4} $$
proven by induction using equation $(1)$ and the
identity $$(1 + r/2) = \sqrt{1 + r(1 + r/4)}\;\;
\text{ where } \;\; r = 2^{-n}. \tag{5} $$
The question asked about
$\,f(\frac12,\frac12) = \frac54\,$ using equation $(4)$
with $\,n=1.$
NOTE: In equation $(2)$ the continued square root is
the limit of a sequence
$$ x,\; \sqrt{1\!+\!t\,x},\;
\sqrt{1\!+\!t\sqrt{1\!+\!t\,q\,x}},\;
\sqrt{1\!+\!t\sqrt{1\!+\!t\,q\sqrt{1\!+\!t\,q^2x}}},\;\cdots $$
which converges at least for
non-negative $\,t,q,x\,$ which needs some kind
of proof in general.
Best Answer
We can do this much quicker than using prime factorization. Below I show how to reduce the problem to testing if an integer is a (specific) perfect power - i.e. an integer perfect power test.
Lemma $\ $ If $\rm\,R\,$ and $\,\rm K/N\:$ are rationals, $\rm\:K,N\in\mathbb Z,\ \gcd(K,N)=1,\,$ then $$\rm\:R^{K/N}\in\Bbb Q\iff R^{1/N}\in \mathbb Q\qquad$$
Proof $\ (\Rightarrow)\ $ If $\,\rm\color{#0a0}{R^{K/N}\in\Bbb Q},\,$ then by $\rm\:gcd(N,K) = 1\:$ we have a Bezout equation
$$\rm 1 = JN+I\:\!K\, \overset{\!\div\ N}\Rightarrow\ 1/N = J + IK/N\ \Rightarrow\ R^{1/N} =\ R^J(\color{#0a0}{R^{K/N}})^I \in \mathbb Q$$
$(\Leftarrow)\ \ \rm\:R^{1/N}\in \mathbb Q\ \Rightarrow\ R^{K/N} = (R^{1/N})^K\in \mathbb Q.\ \ \small\bf QED$
So we've reduced the problem to determining if $\rm\:R^{1/N} = A/B \in \mathbb Q.\,$ If so then $\rm\: R = A^N/B^N\:$ and $\rm\:gcd(A,B)=1\:$ $\Rightarrow$ $\rm\:gcd(A^N,B^N) = 1,\:$ by unique factorization or Euclid's Lemma. By uniqueness of reduced fractions, this is true iff the lowest-terms numerator and denominator of $\rm\:R\:$ are both $\rm\:N'th\:$ powers of integers.
So we reduce to the problem of checking if an integer is a perfect power. This can be done very quickly, even in the general case, see D. J. Bernstein, Detecting powers in almost linear time. 1997.