The title says it all. 


A very similar question was asked and answered about linear groups, but none of the counterexamples are algebraic:
[Are extensions of linear groups linear?](https://mathoverflow.net/questions/22814/are-extensions-of-linear-groups-linear)


If $A$, $B$ are affine and there is a rational section of $C \to A$ in $1 \to B \to C \to A \to 1$, then $C \to A$ is affine, so $C$ is affine. But if not?



Are extensions of linear algebraic groups (over a field) themselves linear algebraic?
Yes. The point is that $C$ is a $B$-torsor over $A$. Since being affine is a local property in the fpqc topology, $C$ is affine over $A$.


[Edit]: Sorry I had not noticed grp's comment, or I wouldn't have posted an answer.


At to why there are local section, well, to me that's by the definition of an extension. Alternatively, assuming you are on a field, the injectivity of $A \to B$ means, I suppose, that $A$ is an embedding of algebraic groups. This defines a free action of $A$ on $C$; take the quotient $B/A$ (as an fppf sheaf, or étale, if $A$ is smooth); the projection $B \to B/A$ has local sections, by construction. It's a basic result that $B/A$ is represented by a group scheme. Then the exactness of the sequence should meant that $B \to C$ induces an isomorphism of $B/A$ with $C$.


If you are over an algebraically closed of characteristic 0, exactness of the sequence can be checked, in fact, at the level of closed points.


