Let $R$ be a commutative ring and let $M$ and $N$ be $R$-modules. Let $\mathfrak{a}$ be an ideal in the annihilator of $M$ and in the annihilator of $N$. An $R$-homomorphism $f: M\to N$ is in particular a $R/\mathfrak{a}$-homomorphism. However, is there an isomorphism of $R/\mathfrak{a}$-modules or $R$-modules $$\mathrm{Hom}_{R}(M, N)\cong\mathrm{Hom}_{R/\mathfrak{a}}(M, N)?$$
I believe there is an isomorphism of $R$-modules and of $R/\mathfrak{a}$-modules, given by the identity $f\mapsto f$. Does anyone disagree with this evaluation?
Yes it is an isomorphism of $R/\mathfrak{a}$-modules.
Let's write out how the hom s are endowed with module structure for each to see that this preservation is a matter of how to view the $Hom_R(M,N)$ as an $R/\mathfrak{a}$ module.
The action of $R$ on a module $P$ can be written as $\mu : R × P → P$ or as a map $R ⊗P →P$. It seems to have caused some confusion that I used the latter approach, so let's keep things simple and switch to using $μ$ above.
The main question is, what is μ (the multiplication making something a module) for the case of ${End}_R(M,N)$ and $R/\mathfrak{a}$?
$Hom_R(M,N)$ has the module structure given by $f ⊗ r ↦ (a ↦ rf(a) = f(ra))$. That's the tensor approach but you can also think about the function
$$R × Hom_R(M,N) → Hom_R(M,N)$$
such that
$$(r, f) ↦ f_r $$ where $f_r$ sends $a$ to $rf(a)$.
Using the tensor approach, in which we describe the structure map of a module using the tensor product, $Hom_{R/\mathfrak{a}}(M,N)$ has the unique module structure sending a simple tensor $f ⊗ r$ to $(a ↦ \overline{r}f(a) = f(\overline{r}a))$
Here the "mapsto" symbol names a function by a formula for a variable. In a computer proof assistant like lean that can be done with λ(a:M)↦φ(a), though it's important to understand that this is a shorthand.
The key equation is this one:
$$\overline{r} \cdot_{R/\mathfrak{a}} f = r \cdot_{R} f$$
Which is actually the linearity of the map you gave (it's the linearity of the identity map on the underlying sets).