Find all odd prime numbers $p$ for which there exists a natural number $g$ for which the sets \[A=\left\{ \left( {{k}^{2}}+1 \right)\,\bmod p|\,k=1,2,\ldots ,\frac{p-1}{2} \right\}\] and \[B=\left\{ {{g}^{k}}\bmod \,p|\,k=1,2,...,\frac{p-1}{2} \right\}\] are equal.
To solve the problem, we need to find all odd prime numbers \( p \) for which there exists a natural number \( g \) such that the sets 
\[ A = \left\{ (k^2 + 1) \bmod p \mid k = 1, 2, \ldots, \frac{p-1}{2} \right\} \]
and 
\[ B = \left\{ g^k \bmod p \mid k = 1, 2, \ldots, \frac{p-1}{2} \right\} \]
are equal.

1. **Redefine the sets**:
   We redefine the sets as follows:
   \[ A' = \left\{ k^2 \bmod p \mid k = 1, 2, \ldots, \frac{p-1}{2} \right\} \]
   \[ B' = \left\{ g^k - 1 \bmod p \mid k = 1, 2, \ldots, \frac{p-1}{2} \right\} \]

2. **Properties of \( g \)**:
   Clearly, \( g \) must be a generator modulo \( p \). This means \( g \) generates all non-zero residues modulo \( p \).

3. **Condition on \( p \)**:
   Given that \( g \) is a generator, \( p \) must be of the form \( p \equiv 3 \pmod{4} \). This is because if \( p \equiv 1 \pmod{4} \), there exists some \( k \) such that \( k^2 + 1 \equiv 0 \pmod{p} \), which would imply \( k^2 \equiv -1 \pmod{p} \), contradicting the properties of quadratic residues modulo \( p \).

4. **Mapping elements**:
   We need each element in \( A' \) to map 1:1 to the elements of \( B' \). Specifically, we need:
   \[ g^2, g^4, \ldots, g^{4n+2} \]
   to map 1:1 via modulo \( p \) to:
   \[ g - 1, g^2 - 1, \ldots, g^{2n+1} - 1 \]

5. **Contradiction**:
   Suppose \( g - 1 \equiv g^{2m} \pmod{p} \) for some \( m \leq 2n+1 \). Multiplying both sides by \( g^{4n-1} \), we get:
   \[ 1 - g^{4n-1} \equiv g^{2m-1} \pmod{p} \]
   This implies:
   \[ g^{4n-1} - 1 \equiv -g^{2m-1} \pmod{p} \]
   Since \( p \equiv 3 \pmod{4} \), we know that \( -g^{2m-1} \equiv g^{2\ell} \pmod{p} \) for some \( \ell \). This leads to a contradiction because \( g, g^3, \ldots, g^{4n+1}, 0 \) cannot map 1:1 to \( g^{2n+2} - 1, g^{2n+3} - 1, \ldots, g^{4n+2} - 1, -1 \).

Therefore, the only possible value for \( p \) is \( p = 3 \).

The final answer is \( \boxed{ p = 3 } \).