Each automorphism of the quaternion algebra is inner and it is an orthogonal mapping with the determinant 1.


Let $f: \mathbb H \rightarrow \mathbb H$ be in $SO(4)$. Does there exists a quaternion $q$ with $\|q\|=1$ and an automorphism $g$ of $\mathbb H$ such that $f(x)=qg(x)$ for $x\in \mathbb H$ ?



Automorphisms and isometries of the quaternions
In other words, what you are asking is whether every $f\colon\mathbb{H}\to\mathbb{H}$ in $\mathit{SO}\_4$ takes the form $x\mapsto \bar u x v$ where $u,v$ are unit quaternions (the connection with your notation is that then $f$ is the composition of the inner automorphism $g\colon x\mapsto \bar v x v$ with left-multiplication by $q = \bar u v$). This is a well-known fact: see, e.g., Conway & Smith, *On Quaternions and Octonions* (A. K. Peters 2003), §4.1.


Furthermore, this can be seen as an isomorphism $\mathit{Spin}\_3\times\mathit{Spin}\_3 \to \mathit{Spin}\_4$ taking a pair $(u,v)$ of unit quaternions (the group of unit quaternions is isomorphic to $\mathit{Spin}\_3$ acting by conjugation) to $x\mapsto \bar u x v$.


