Let $$f(x) = Q(x) + v\quad\text{and}\quad g(x) = P(x) + w$$ be 2 isometries of $\mathbb{R^n}$.
Write the composition $g ◦ f$ in the form $U(x) + z$, with $Q, P, U \in O(n)$ and $v, w, z \in \mathbb{R^n}$
Attempt at solving the question:
$$g ◦ f = g(f(x)) = g(Q(x)+v) = P(Q(x)+v)+w = P(Q(x)) + (v +w),$$
so we have $U(x) = P(Q(x))$ and $v+w = z$.
Is that the right approach to solve the question?
The idea is fine, you just messed up in the end:
$$g(f(x)) = g(Qx+ v) = P(Qx+v) + w = PQx + Pv + w,$$so $U = PQ$ and $z = Pv + w $.