Let $A \subseteq B$ be two (associative with $1$) $k$-algebras, where $k$ is a field of characteristic zero, and let $f$ be a $k$-automorphism of $A$.


I am interested to know 'when' one can extend $f$ to a $k$-automorphism of $B$.


Three nice answers:
(1) [This question](https://mathoverflow.net/questions/192281/inner-and-extendible-automorphisms-of-c-algebras) deals with $C^\*$-algebras. 
(2) [This paper](https://link.springer.com/article/10.1007/s002290200276) deals with extending involutions on Frobenius algebras.
(3) [A counter-example](https://math.stackexchange.com/questions/1406080/extending-automorphisms-in-complete-boolean-algebras) for Boolean algebras.


Since my question is too general, I do not mind to concentrate on commutative algebras only (which are not fields), and $f$ of finite order (for example, $f$ is an involution, namely, of order $2$).


Thank you very much for any comment.



Extending an automorphism from a sub-algebra to the algebra
The short answer to your question is: almost never. Many counterexamples have already been constructed in the comments. Let me make another easy counterexample:


**Example.** Let $k$ be algebraically closed, and let $A = k[t]$, $B = k[\sqrt{t}] = k[x]$. Consider the automorphism $t \mapsto t+1$ of $A$. It cannot be extended to $B$, since $t+1$ is not a square in $B$ (equivalently, $x^2 + 1$ is not a square in $k[x]$).


**Example.** Similarly, the automorphism $t \mapsto t+1$ of $k(t)$ cannot be extended to $k(\sqrt{t})$. Thus, even for a finite extension of fields containing an algebraically closed field $k$, it is false in general.


**Remark.** This example is actually rather instructive, because $k[t]$ has *many* automorphisms: any $a,b \in k$ with $a \neq 0$ give rise to the automorphism $t \mapsto at + b$. When $b \neq 0$, this cannot be extended to $k[\sqrt{t}]$.


Similarly, the automorphisms of $k(t)$ over $k$ are given by $PGL\_2(k)$. Indeed, automorphisms of $k(t)$ are the same thing as automorphisms of $\mathbb P^1$, since the category of transcendence degree $1$ field extensions of $k$ is equivalent to the category of smooth projective curves over $k$ with surjective maps.


Clearly a necessary criterion for an automorphism of $\mathbb P^1$ to extend to the double cover $\mathbb P^1 \to \mathbb P^1$ is that it preserves the branch locus $\{[0:1],[1:0]\}$. The only matrices that do this are $$\pmatrix{a & b\\c & d} \in PGL\_2(k)$$ with either $b = c = 0$ or $a = d = 0$. This corresponds to the automorphisms $t \mapsto \lambda t$ or $t \mapsto \lambda t^{-1}$. Another way to see this is by letting the automorphism act on the complement $\mathbb A^1\setminus\{0\}$ of $\{[0:1],[1:0]\}$. This is given by $k[t,t^{-1}]$, and an endomorphism must map $t$ to an invertible element, i.e. to some $\lambda t^k$. It's an automorphism iff $k = \pm 1$.


Finally, these do indeed extend to automorphisms of the overlying $\mathbb P^1$, by $x \mapsto \sqrt{\lambda}\cdot x^{\pm 1}$. But this is really just a coincidence:


**Remark.** For a morphism of curves $C \to D$ and an automorphism $\phi$ of $D$, it is not in general sufficient for $\phi$ to fix the branch locus in order for it to lift to an automorphism of $C$. For example, let $C$ be a general curve of genus $\geq 3$. Then $C$ has no nontrivial automorphisms; see e.g. the various answers to [this question](https://mathoverflow.net/q/54994/82179). In particular, we can choose such $C$ to be defined over $\bar{\mathbb Q}$.


But if $C$ is defined over $\bar {\mathbb Q}$, then Belyi's theorem it admits a map to $\mathbb P^1$ ramified at three points only. (It should in principle be possible to write down an *explicit* example of a curve admitting a map to $\mathbb P^1$ ramified at three points and with no nontrivial automorphisms, but I don't have one at hand.)


Then any permutation of the branch locus can be realised by some automorphism of $\mathbb P^1$ (since $PGL\_2(k)$ acts transitively on triples of points in $\mathbb P^1$), but this map cannot be extended to $C$ since $C$ has no automorphisms.


This gives more examples of transcendence degree $1$ field extensions $A \subseteq B$ of $k$ where a $k$-automorphism of $A$ does not extend to $B$.


