Given a prime number $p$ and a set $S$ of $n$ rational numbers. Multiply all $n$ rational numbers we get a number $M$. For each number $x$ in the set $S$, we have $\frac{p+M}{x}$ is an integer. Is it possible to prove that $M$ is also an integer?
For $n = 2$, let $S=\left\{x,y\right\}$. Then $\frac{p+M}{x}=\frac{p}{x}+y$, $\frac{p+M}{y}=\frac{p}{y}+x$ are integers, then multiply the two numbers we have $\frac{p^2}{M}+2p + M$ is an integer, thus $\frac{p^2}{M} + M=\alpha$ is an integer. If $M=\frac{A}{B}$ with $A$, $B$ are coprime, then $B^2\times p^2+A^2=\alpha A B$ so $B|A^2$ then $B=1$, thus $M$ is an integer.
Is it true that for every $n>2$, $M$ is an integer? If not, then what are the conditions of $n$ so that $M$ must be an integer?
Edit: If $M$ is an integer, then is $M$ a power of $p$?
Your approach can be generalized to give that
$$\frac{(p+M)^n}{M}\in\mathbb{Z}.$$
Letting $M=a/b$ with $\gcd(a,b)=1$ and $b>0$,
$$\frac{(bp+a)^n}{ab^{n-1}}\in\mathbb{Z}.$$
Since $b|(bp+a)^n$, we have $b|a^n$, which means $b=1$. Thus
$$\frac{(p+a)^n}{a}\in\mathbb{Z},$$
which implies $a|p^n$ and thus $a$ is a (positive or negative) power of $p$.
Remark. We did not use the primality of $p$ anywhere in the proof that $b=1$, only in the proof that $a$ is a power of $p$.