Edit: I answered a companion question (for entire functions). I suppose the underlying question (as sort of explained in the comments) is to characterize the real analytic $f$ without zeroes.
Weierstrass factorization theorem says the following: Suppose that $f$ is entire. Then $f$ has only countably many zeros (possibly only finitely many), counting multiplicities; if $0$ is a zero of multiplicity $k$, and $z_1,z_2,\dots$ enumerates the distinct non-zero zeros of $f$ (of multiplicities $m_1,m_2,\dots$, respectively), then there is an entire function $g(z)$ and a sequence $p_1,p_2,\dots$ of integers such that $ f(z)=z^k e^{g(z)}\prod_{n\ge 1}E_{p_n}(z/z_n), $ where the $E_k(z)$ are the elementary factors, given by $ E_0(z)=1-z $ and, for $n>0$, $E_n(z)=(1-z)exp(z+\frac{z^2}2+\dots+\frac{z^n}n).$
(There is also a more general version of this result for functions that are not entire.)
Note that if $f$ has only finitely many zeroes, then it follows that $f$ has the form $p(z)e^{h(z)}$ for some entire $h$ and polynomial $p$.
Also, this indicates the enormous variety of entire functions with given zeroes at prescribed locations, and gives a hint of how to build any. (There are general estimates on the sizes of the elementary factors and general results on convergence of infinite products that can be combined to check in specific cases that a product as above indeed defines an entire function.)