I think I must have missed something along the way. Can someone please explain to me step by step how to solve this?

f(x)=1/(x-1), g(x)=(x-1)/(x+1). Find fog gof, fof, gog and their domains.

First of all, I don't think I even grasp the concept of multiplying with x? I'm very confused and need some serious help. I cannot do functions.