Find the number of functions $f:\mathbb{Z}\mapsto\mathbb{Z}$ for which $f(h+k)+f(hk)=f(h)f(k)+1$, for all integers $h$ and $k$.
1. **Substitute \( k = 1 \) into the given functional equation:**
   \[
   f(h+1) + f(h) = f(h)f(1) + 1 \quad \text{(Equation 1)}
   \]

2. **Substitute \( h = k = 0 \) into the given functional equation:**
   \[
   f(0+0) + f(0) = f(0)f(0) + 1 \implies 2f(0) = f(0)^2 + 1
   \]
   Solving the quadratic equation \( f(0)^2 - 2f(0) + 1 = 0 \):
   \[
   (f(0) - 1)^2 = 0 \implies f(0) = 1
   \]

3. **Substitute \( h = -k \) into the given functional equation:**
   \[
   f(-h^2) + f(0) = f(h)f(-h) + 1 \implies f(-h^2) + 1 = f(h)f(-h) + 1 \implies f(-h^2) = f(h)f(-h)
   \]
   For \( h = 1 \):
   \[
   f(-1) = f(1)f(-1)
   \]
   This implies two cases:
   - \( f(-1) = 0 \)
   - \( f(1) = 1 \)

4. **Case 1: \( f(-1) = 0 \)**

   - Substitute \( h = -2 \) and \( k = 1 \):
     \[
     f(-2+1) + f(-2) = f(-2)f(1) + 1 \implies f(-1) + f(-2) = f(-2)f(1) + 1 \implies 0 + f(-2) = f(-2)f(1) + 1
     \]
     \[
     f(-2) = f(-2)f(1) + 1
     \]
     - Substitute \( h = k = -1 \):
       \[
       f(-1-1) + f(1) = f(-1)f(-1) + 1 \implies f(-2) + f(1) = 1
       \]
       \[
       f(-2) + f(1) = 1
       \]
     - Combining the equations:
       \[
       f(-2) = f(-2)f(1) + 1 \quad \text{and} \quad f(-2) + f(1) = 1
       \]
       - If \( f(1) = 0 \):
         \[
         f(h+1) + f(h) = 1 \implies f(h+1) = 1 - f(h)
         \]
         This implies:
         \[
         f(1) = 0, f(2) = 1, f(3) = 0, f(4) = 1, \ldots
         \]
         Therefore, \( f(\text{odd number}) = 0 \) and \( f(\text{even number}) = 1 \). This is one function.

       - If \( f(-2) = -1 \):
         \[
         f(-2) + f(1) = 1 \implies -1 + f(1) = 1 \implies f(1) = 2
         \]
         Substitute into Equation 1:
         \[
         f(h+1) + f(h) = 2f(h) + 1 \implies f(h+1) = f(h) + 1
         \]
         This implies:
         \[
         f(x) = x + C
         \]
         Given \( f(-2) = -1 \):
         \[
         -2 + C = -1 \implies C = 1
         \]
         Therefore, \( f(x) = x + 1 \). This is another function.

5. **Case 2: \( f(1) = 1 \)**

   - Substitute into Equation 1:
     \[
     f(h+1) + f(h) = f(h) + 1 \implies f(h+1) = 1
     \]
     Therefore, \( f(x) = 1 \). This is another function.

Conclusion:
There are three functions that satisfy the given functional equation:
1. \( f(\text{odd number}) = 0 \) and \( f(\text{even number}) = 1 \)
2. \( f(x) = x + 1 \)
3. \( f(x) = 1 \)

The final answer is \(\boxed{3}\)