For problem 1, just sketch the region S and think about triangles.

For problem 2, f commutes with all g under functional composition. That's quite a strong condition. I think the angle of attack would be to consider really simple cases. For example. if f(x) = c for all x, then f(g(x)) = c but g(f(x)) = g(c), which is not true for all polynomials g. Pick g(x) = c+1 and you have g(f(x)) = g(c) = c+1 which doesn't equal c. So f(x) is not a constant. What if you try linear polynomials?