Hope I've posted this question in the right place- I think I did.. But anyway.

Let a be a positive number, let f : [2,∞) → R, f (x) = a − x and let g: (−∞, 1] → R,

g(x) = x^2 + a. Find all values of a for which f ◦ g and g ◦ f both exist.

I've no clue how to do this could someone show me?