  In the Hilbert space $H$, the inverse problem of determining the right-hand
side of the abstract subdiffusion equation with the fractional Caputo
derivative is considered. For the forward problem, a non-local in time
condition $u(0)=u(T)$ is taken. The right-hand side of the equation has the
form $fg(t)$, and the unknown element is $f\in H$. If function $g(t)$ does not
change sign, then under a over-determination condition $ u (t_0)= \psi $,
$t_0\in (0, T)$, it is proved that the solution of the inverse problem exists
and is unique. An example is given showing the violation of the uniqueness of
the solution for some sign-changing functions $g(t)$. For such functions
$g(t)$, under certain conditions on this function, one can achieve
well-posedness of the problem by choosing $t_0$. And for some $g(t)$, for the
existence of a solution to the inverse problem, certain orthogonality
conditions must be satisfied and in this case there is no uniqueness. All the
results obtained are also new for the classical diffusion equations.
