2. $n$ is all positive integers greater than 1.
$$
\text { Let } n=2^{t} m(t \geqslant 0,(m, 2)=1) \text {. }
$$

Consider the simplest form of the fraction $\frac{k}{n}$, its numerator is even if and only if $2^{t+1} \mid k$.

From the fact that among $1,2, \cdots, n-1$ there are exactly $\frac{m-1}{2}$ multiples of $2^{i+1}$, we know
$$
f(n) \equiv n-1-\frac{m-1}{2}(\bmod 2) .
$$

Thus $f(n)$ is even if and only if $n-1$ and $\frac{m-1}{2}$ have the same parity, i.e.,
$m \equiv 1(\bmod 4), n$ is odd;
$m \equiv 3(\bmod 4), n$ is even.
Note that, $n$ has the same parity as 2015, $m$ and $2015 m$ are not congruent modulo 4.
Therefore, $f(n)$ and $f(2015 n)$ have different parities.
2. Let $n>1$ be a positive integer. Consider the numbers $\frac{1}{n}, \frac{2}{n}, \cdots, \frac{n-1}{n}$ in their simplest forms. Let $f(n)$ denote the sum of the numerators of these simplest fractions. If $f(n)$ and $f(2015 n)$ have different parities, find all possible values of $n$.

The text is translated while preserving the original line breaks and format.