Difficulty showing the isomorphism $ \text{Hom}_R(P \otimes_S N, M) \equiv \text{Hom}_S(N, \text{Hom}_R(P,M)) $ I have trouble understanding the construction of the isomorphism
$$
\text{Hom}_R(P \otimes_S N, M) \equiv \text{Hom}_S(N, \text{Hom}_R(P,M)) 
$$
where $P$ is a $R-S-$bimodule, $N$ is a left $S$-module, and $M$ is a right $R$-module. (I may be missing other possible module structures on $M$ and $N$.)
I started with verifying why each side makes sense. Because of module structure of $P$, the tensor product $P \otimes_S N$ makes sense. Further $P \otimes_S N$ can be made into a left $R$-module via the scalar multiplication: $$r.(p \otimes n) := rp \otimes n.$$
It is also a right $S$-module via: $$ s. (p \otimes n):= (ps)\otimes n$$
Also, $\text{Hom}_R(P \otimes_S N, M)$ can be made a right $S$-module via:
$$ (\phi\cdot s )(p \otimes n):= \phi(ps \otimes n).$$
Further $\text{Hom}_R(P,M)$ can be made a right $S$-module via:
$$ \psi \cdot s := ( p \mapsto \psi(ps)).$$
And like above, the set $\text{Hom}_S(N, \text{Hom}_R(P,M)) $ makes sense as a right $S$-module.
Now let’s define a map
$$ S: \text{Hom}_R(P \otimes_S N, M) \rightarrow \text{Hom}_S(N, \text{Hom}_R(P,M)) $$ as
$$ S(\phi):= f, f: n \mapsto f(n), f(n)(p):= \phi(p \otimes n)$$
I am having trouble showing that the above map $S$ is indeed well-defined. Additivity of both $\phi(n)$ and $f$ is clear but I think due to possibly some missing/incorrect module structures on the above sets, showing linearity is being tricky.
Can someone suggest where are the possible flaws in the above module structures?
I will appreciate any help, any of you have to offer.
Thank you for the help.
 A: Edit:
I will first address the general form of the Tensor-Hom adjunction.
In general, the Tensor-Hom adjunction states that if $X$ is an $(R, S)$-bimodule, $Y$ an $(A, R)$-bimodule and $Z$ a $(B, S)$-bimodule then $$\mathrm{Hom}_S(Y \otimes_R X, Z) = \mathrm{Hom}_R(Y, \mathrm{Hom}_S(X, Z))$$ as $(B, A)$-bimodules.
The proof is as follows: Since $X$ is a right $S$-module, we have a right $S$-module structure on $Y \otimes_R X$. Thus $\mathrm{Hom}_S(Y \otimes_R X, Z)$ makes sense. Now, since $Y$ is a left $A$-module, we have a left $A$-module structure on $Y \otimes_R X$, so we can define a right $A$-module structure on $\mathrm{Hom}_S(Y \otimes_R X, Z)$ by sending $f : Y \otimes_R X \to Z$ to the homomorphism $(fa)(p) = f(ap)$ (verify this). Since $Z$ is a left $B$-module, we can define a left $B$-module structure by $(bf)(p) = bf(p)$. Now $((bf)a)p = (bf)(ap) = bf(ap) = b((fa)p) = (b(fa))(p)$, so we have a $(B, A)$-bimodule.
Similarly, we have left $R$-module structure on $X$, so we can define a right $R$-module structure on $\mathrm{Hom}_S(X, Z)$ as follows: for $f : X \to Z$ we define $fs$ by $(fs)(x) = f(sx)$. Thus $\mathrm{Hom}_R(Y, \mathrm{Hom}_S(X, Z))$ makes sense. Now since $Z$ is a left $B$-module,we can define a left $B$-module structure on $\mathrm{Hom}_S(X, Z)$ by sending $f: X \to Z$ to the morphism $(bf)(x) = bf(x)$. Similarly we get a left $B$-module structure on $\mathrm{Hom}_R(Y, \mathrm{Hom}_S(X, Z))$. The right $A$-module structure is given by sending $f : Y \to \mathrm{Hom}_S(X, Z)$ to $(fa)(y) = f(ay)$. You can verify these structure are compatible and you get a $(B, A)$-bimodule.
We now show they are isomorphic as $(B, A)$-bimodules. Let $f : Y \otimes_R X \to Z$. We define $$\varphi : \mathrm{Hom}_S(Y \otimes_R X, Z) = \mathrm{Hom}_R(Y, \mathrm{Hom}_S(X, Z))$$ by $\varphi(f)(y)(x) = f(y \otimes x)$. You know how to show additivity, so I will only show linearity.
Let $b \in B$, then $$\begin{aligned}
\varphi(bf)(y)(x) &= (bf)(y \otimes x) \\
&= bf(y \otimes x) \\
&= b (\varphi(f)(y))(x) \\
&= (b(\varphi(f)(y)))(x) \\
&= ((b\varphi(f))(y))(x) \\
&= (b\varphi(f))(y)(x),
\end{aligned}$$
by filling in definitions and using the appropriate module structures (parentheses are hopefully clear enough where necessary).
Similarly, for $a \in A$ we have $$\begin{aligned}
\varphi(fa)(y)(x) &= (fa)(y \otimes x) \\
                  &= f(a(y \otimes x)) \\
                  &= f(ay \otimes x) \\
                  &= (\varphi(f)(ay))(x) \\
                  &= (\varphi(f)a)(y)(x)
\end{aligned}.
$$
For an inverse, let $g: Y \to \mathrm{Hom}_S(X, Z)$, then define $\psi(g) : Y \times X \to Z$ by $\psi(g)(y, x) = g(y)(x)$, check the usual conditions to get a map from $Y \otimes_R X \to Z$ and show that it is an inverse.
Addressing your question:
Let $P$ be a $(R, S)$-bimodule, $N$ a left $S$-module and $M$ a right $R$-module.
Then $P \otimes_S N$ has a structure of a left $R$ module, while $M$ has the structure of a right $R$-module.
Now, a module homomorphism $f : P \otimes_S N \to M$ must satisfy $f(rp) = f(p)r$, but then $f(p)rr' = f((rr')p) = f(r(r'p)) = f(r'p)r = f(p)r'r$, so the module structures on $P, N, M$ don't seem like very natural choices, unless the rings are commutative. I believe the following will work under that assumption.
I am not entirely sure if this is what you're asking, but I will show that $$S(\phi \cdot s) = S(\phi) \cdot s.$$
You haven't mentioned it explicitly in your post, but the module structure on $\mathrm{Hom}_S(N, \mathrm{Hom}_R(P, M))$ is given by sending the morphism of $S$-modules $f : N \to \mathrm{Hom}_R(P, M)$ to the morphism $f \cdot s$ sending $n \in N$ to $f(n \cdot s) = f(n) \cdot s$. Here $f(n) \in \mathrm{Hom}_R(P, M)$ and the action is given by the one in your post.
We show first that $S(\phi \cdot s)(n) = (S(\phi) \cdot s)(n)$: note that for any $p \in P$ we have that $$\begin{aligned}
S(\phi \cdot s)(n)(p) &= (\phi \cdot s)(p \otimes n) \\
&= \phi (ps \otimes n) \\
&= S(\phi)(n)(ps) \\
&= (S(\phi)(n) \cdot s)(p) \\ 
&= S(\phi)(n \cdot s)(p) \\
&= (S(\phi) \cdot s)(n)(p).
\end{aligned}$$
Here the first 3 lines is just unwinding definitions, the fourth line uses the module structure on $\mathrm{Hom}_R(P, M)$, the fifth line the fact $S(\phi)$ is a homomorphism of $S$-modules, and the sixth line the module structure of $\mathrm{Hom}_S(N, \mathrm{Hom}_R(P, M))$.
