Consider the power series ring $\mathbf{Z}_p[[T]]$, where $\mathbf{Z}_p$ denotes the $p$-adic integers. I'll call a function $f(T) \in \mathbf{Z}_p[[T]]$ a rational function if I can write it as:
$$f(T) = \dfrac{g(T)}{h(T)} $$
where $g, h \in \mathbf{Z}_p[[T]]$ are polynomials. (Note that $g(T)/h(T)$ is shorthand for $g(T)$ times the multiplicative inverse of $h(T)$.)
My question is: is it possible to characterize which elements of $\mathbf{Z}_p[[T]]$ are rational functions? If I am given $f(T) \in \mathbf{Z}_p[[T]]$, and I write it as $f(T) = \sum a_nT^n$, can I tell whether $f(T)$ is a rational function just by looking at the coefficients $a_n$?