I am tasked to find an entire function with roots exactly in $\pm \sqrt{n}$ and $\pm i\sqrt{n}$ where $n\in \mathbb{N}$
My attempt:
My naive approach was to use $f(z) = \sin(z)$ as an Ansatz, which is clearly entire.
Then, $$f(z) = \sin(\pi \cdot z^2)$$
should satisfy the requirements for $n\in \mathbb{Z}$, because $\sin(\pi \cdot (\pm\sqrt{n})^2) = \sin(\pi\cdot n)=0$ and $\sin(\pi \cdot (\pm i\sqrt{n})^2) = \sin(-\pi\cdot n)=0$.
Clearly, the roots of $f$ are all simple. So what I think is left to to is to find an function $g\in H(\{z = x+iy: x<0\})$ such that $g$ has no roots and $$h(z) = \cases{g(z), \quad z\in \{z = x+iy: x<0\} \\ f(z), \quad z\in \{z = x+iy: x\geq 0\}}$$
My candidate for $g$ is $g(z) = e^{\pi z}-1$ which is also entire and has no roots in the left half-plane.
\begin{align*} &\lim_{z\rightarrow 0- } h(z) =\lim_{z\rightarrow 0- } \frac{g(z)-g(0)}{z} =\lim_{z\rightarrow 0- } \frac{e^{\pi z}-1}{z} = \pi \\ &\lim_{z\rightarrow 0+ } h(z) =\lim_{z\rightarrow 0+ } \frac{f(z)-f(0)}{z}\lim_{z\rightarrow 0+ } \frac{\sin{\pi z}}{z} = \lim_{z\rightarrow 0+ } (\frac{\pi z}{1!\cdot z} - \frac{(\pi z)^3}{3!\cdot z} + \frac{(\pi z)^5}{5!\cdot z} \pm ....) = \pi \end{align*}
which shows $h$ is differentiable in $0$. That should make $h$ an entire function with roots exactly in $\pm \sqrt{n}, \pm i\sqrt{n}$ for $n\in \mathbb{N}$.
Is that correct? Or do I have to do it differently?