Given a prime number $p$. It is known that for each integer $a$ such that $1<a<p/2$ there exist integer $b$ such that $p/2<b<p$ and $p|ab-1$. Find all such $p$.
1. **Define the function and establish bijection:**
   The function \( f: \{1, 2, \dots, p-1\} \to \{1, 2, \dots, p-1\} \) defined by \( x \to \frac{1}{x} \pmod{p} \) is a bijection. This is because for any \( x \) in the set, there exists a unique \( y \) such that \( xy \equiv 1 \pmod{p} \).

2. **Eliminate large primes \( p > 80 \):**
   For \( p > 80 \), consider the product \( 2 \cdot \frac{p+1}{2} \equiv 1 \pmod{p} \). This implies \( 2 \cdot \frac{p+1}{2} = \frac{p-1}{2} \cdot p - 2 \equiv 1 \pmod{p} \). Thus, \( |n - f(n)| \neq 1, 2 \) for \( p > 7 \). This is because the only way \( |n - f(n)| = 1, 2 \) involves \( n \) or \( f(n) \) being \( \frac{p-1}{2} \) or \( \frac{p+1}{2} \), which is not possible.

3. **Claim 1: \( p \equiv 2, 3 \pmod{5} \):**
   - Consider the equation \( x(x+1) \equiv 1 \pmod{p} \). This can be rewritten as \( (2x+1)^2 \equiv 5 \pmod{p} \).
   - By quadratic reciprocity, \( -1 = \left( \frac{5}{p} \right) = (-1)^{\frac{5-1}{2} \cdot \frac{p-1}{2}} \left( \frac{p}{5} \right) = \left( \frac{p}{5} \right) \).
   - This implies \( p \equiv 2, 3 \pmod{5} \).

4. **Claim 2: \( p \equiv 3, 5 \pmod{8} \):**
   - Consider the equation \( x(x+2) \equiv 1 \pmod{8} \). This can be rewritten as \( (x+1)^2 \equiv 2 \pmod{8} \).
   - By the second supplement law of quadratic reciprocity, \( \left( \frac{2}{p} \right) = -1 \).
   - This implies \( p \equiv 3, 5 \pmod{8} \).

5. **Check for contradictions:**
   - If \( p \equiv 2 \pmod{5} \), then \( 5 \mid 2p + 1 \). This leads to a contradiction since \( 5, \frac{2p+1}{5} < \frac{p}{2} \).
   - If \( p \equiv 3 \pmod{5} \) and \( p \equiv 3 \pmod{8} \), then \( 40 \mid 13p + 1 \). This leads to a contradiction since \( 40, \frac{13p+1}{40} < \frac{p}{2} \).
   - If \( p \equiv 3 \pmod{5} \) and \( p \equiv 5 \pmod{8} \), then \( 40 \mid 3p + 1 \). This leads to a contradiction since \( 40, \frac{3p+1}{40} < \frac{p}{2} \).

6. **Check for small primes:**
   - We must now check for finitely many \( p \), namely \( p \in \{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79\} \).
   - The solution set ends up being \( p \in \{5, 7, 13\} \).

The final answer is \( \boxed{ \{5, 7, 13\} } \)