  The study examines the inverse problem of finding the appropriate right-hand
side for the subdiffusion equation with the Caputo fractional derivative in a
Hilbert space represented by $H$. The right-hand side of the equation has the
form $g(t)f$ and an element $f\in H$ is unknown. If the sign of $g(t)$ is a
constant, then the existence and uniqueness of the solution is proved. When
$g(t)$ changes sign, then in some cases, the existence and uniqueness of the
solution is proved, in other cases, we found the necessary and sufficient
condition for a solution to exist. Obviously, we need an extra condition to
solve this inverse problem. We take the additional condition in the form
$\int\limits_0^Tu(t)dt=\psi$. Here $\psi $ is a given element, of $H$.
