By the remainder theorem,
p(a) = 3a³ + a² + 5a = -7
so that
3a³ + a² + 5a + 7 = 0
Since you know a is an integer, you can try to factorize this, or use the rational root theorem to generate a list of potential rational roots, and from there you'd select the integer roots. The rational ones are of the form m/n, where m divides the constant term 7 and n divides the leading coefficient 3. They are
a = ± 1 or ± 1/3 or ± 7 or ±7/3
so there are 4 integer candidates,
a = -1 or 1 or -7 or 7
Check the value of f(a) = 3a³ + a² + 5a + 7 at each of these:
a = -1 → f(a) = 0
a = 1 → f(a) = 16
a = -7 → f(a) = -1008
a = 7 → f(a) = 1120
and only a = -1 is a root of 3a³ + a² + 5a + 7, so that's your answer. In fact,
3a³ + a² + 5a + 7 = (a + 1) (3a² - 2a + 7)