We will need to substitute #color(red)(a + 2)# for each occurrence of #color(blue)(x)# in the original function.
#f(color(blue)(x)) = color(blue)(x)^2 - 3color(blue)(x)#
Becomes:
#f(color(red)(a + 2)) = (color(red)(a + 2))^2 - 3(color(red)(a + 2))#
#f(color(red)(a + 2)) = ((color(red)(a + 2))(color(red)(a + 2))) - 3a - 6#
#f(color(red)(a + 2)) = (a^2 + 2a + 2a + 4) - 3a - 6#
#f(color(red)(a + 2)) = a^2 + 2a + 2a + 4 - 3a - 6#
#f(color(red)(a + 2)) = a^2 + 2a + 2a - 3a + 4 - 6#
#f(color(red)(a + 2)) = a^2 + a - 2#
or
#f(color(red)(a + 2)) = (a + 2)(a - 1)#