Let $f: \mathbb{R}^n \longrightarrow \mathbb{R}$ and let $g: \mathbb{R} \longrightarrow \mathbb{R}$ given by $g(\theta):= f(\theta {\bf y} + (1 − \theta){\bf x})$.
I want to calculate the derivative $g'$.
I set $z=\theta {\bf y}+ (1 − \theta){\bf x}$, then:
$$ \frac{\mathrm{d}g}{\mathrm{d}\theta}= \frac{\mathrm{d}f}{\mathrm{d}\theta}= \frac{\mathrm{d}f}{\mathrm{d}z} \frac{\mathrm{d}z}{\mathrm{d}\theta}= \nabla f^\mathsf{T} ({\bf y}-{\bf x}) $$
Is this formally correct? If it is not wrong, is it possible to write it better?
Yes what you are doing is correct. Perhaps if you want to add more steps, note that
$$ z_{i}=\theta y_{i}+\left(1-\theta\right)x_{i} $$
so that
$$ \frac{\partial z_{i}}{\partial\theta}=y_{i}-x_{i}. $$
Then,
$$ \frac{dg}{d\theta}=\frac{\partial f}{\partial z_{1}}\frac{\partial z_{1}}{\partial\theta}+\cdots+\frac{\partial f}{\partial z_{n}}\frac{\partial z_{n}}{\partial\theta}=\frac{\partial f}{\partial z_{1}}\left(y_{1}-x_{1}\right)+\cdots+\frac{\partial f}{\partial z_{n}}\left(y_{n}-x_{n}\right), $$
which is the inner product you had above. Note that $\nabla f$ is evaluated at $z$.