I want to find an entire function $f$ such that $$\forall n\in \mathbb{Z}: f(n)=|n| \text{ and } f'(n)=\text{sgn}(n)$$
My attempt:
My first idea was to use $\cos(2\pi x)x$ because it's always equal to $x$ for $x\in \mathbb{Z}$ and entire. But since I have to map $f(n)=|n|$, I defined my function as it follows:
\begin{align*} f(x) = \cases{\cos(2\pi z)x \quad \text{ for } x\geq 0 \\ -\cos(2\pi x)x \quad \text{ for } x< 0} \end{align*}
This worked very well with the second condition, because $\forall x_0\in \mathbb{Z}^+\cup\{0\}:$
\begin{align*} \lim_{x\rightarrow x_0} \frac{f(x) - f(x_0)}{x-x_0}=\lim_{x\rightarrow x_0} \frac{\cos(2\pi x)x - x_0}{x-x_0}\overset{\text{L'Hospital}}{=} \lim_{x\rightarrow x_0} (\cos(2\pi x) - 2\pi x \sin(2\pi x)) = \cos(2\pi x_0)= 1 \end{align*}
and $\forall x_0 \in \mathbb{Z}^-:$ $$\lim_{x\rightarrow x_0} \frac{f(x) - f(x_0)}{x-x_0} =...= -\cos(2\pi x_0) = -1$$
So the only problem I have left is the critical point $z = 0$ because it's not differentiable there. (See picture to better understand it) 
So I thought of using a polynomial to interpolate my desired behavior in the interval $[-0.5,0.5]$, because I saw there were extreme points.
Using linear algebra I found a polynomial of 4th degree $p(x)=4x^4-3x^2$ that satisfies the conditions for $0$ and has the same derivative in $-0.5$, $0.5$ as $f$.
So I redefined $f$:
\begin{align*} f(x) = \cases{\cos(2\pi x)x \quad \text{ for } x\geq 0.5 \\ 4x^4-3x^2 \quad \text{ for } -0.5<x<0.5\\ -\cos(2\pi x)x \quad \text{ for } x< -0.5} \end{align*}
This function should satisfy all conditions and is entire. Is this alright? Have I missed an easier/more obvious approach?
Note that $$g(z)=(\frac {\sin {\pi z}}{\pi})^2\sum_{m \in \mathbb Z}\text{sgn}(m)(z-m)^{-2}$$ where as usual $\text{sgn}(0)=0$, is entire as the series converges locally uniformly away from the integers, while for $z=m \ne 0$ the series without the $\text{sgn}(m)(z-m)^{-2}$ term converges locally uniformly, while $(\frac {\sin {\pi z}}{\pi})^2(z-m)^{-2}$ is also analytic.
By construction, we have $g(m)=\text{sgn}(m)$, while it is an easy exercise to see that $g'(m)=0$ since the only thing to prove is that the derivative of $(\frac {\sin {\pi z}}{\pi})^2(z-m)^{-2}$ is zero at $m$ and that follows from the Taylor series of the sine function as when squared it has no degree three term.
Then $f(z)=zg(z)$ satisfies $f(n)=|n|$ and $f'(n)=g(n)+ng'(n)=g(n)=\text{sgn}(n)$