This is a homework question, and my mind is working a little backwards today. So I'm asking for help on a easy question, so that I can unravel the harder ones on my own.
How to create the first order signature with formula "z is GCD of (x and y) or LCM"?
"z is GCD of (x and y) or LCM"
Let's break this into smaller part. It means that $(z\:\text{is GCD of}\:x\:\text{and}\:y)\lor(z\:\text{is LCM of}\:x\:\text{and}\:y)$.
The phrase $z\:\text{is GCD of}\:x\:\text{and}\:y$ means $z$ divides $x$ and $y$ and that $z$ is the smallest such one. Hence, $(z|x)\land(z|y)\land(\forall d:((d|x)\land(d|y)\implies d|z))$. We can break it smaller knowing that $(a|b)$ is also $(\exists n:b=an)$.
Then we just substitute all this into the initial phrase.
You should know where to stop to obtain your first order signature (which I do not know to be honest).