Given two triangles $ABC$ and $A'B'C'$ in $\mathbb A^2$. Define a map $F: \mathbb A^2 \to \mathbb A^2$ as follows: $F(P) = Q$ iff the barycentric coordinates of P w.r.t $A$, $B$ and $C$ are the same as the barycentric coordinates of $Q$ w.r.t. $A'$, $B'$ and $C'$.
How can I prove that $F$ is an affine transformation?
The definition of an affine transformation we use is the following:
$$F : \mathbb A ^{n} \to \mathbb A ^{n} : p \mapsto Ap + b \quad A\text{ not singular matrix} $$
We can also use the fact that if $F : \mathbb A ^{n} \to \mathbb A ^{n}$ with $n \ge 2$ is a bijection that maps collinear points to collinear points, then $F$ is an affine transformation.
This is almost trivial if you happen to know that the points with barycentric coordinates $r_1:r_2:r_3$, $s_1:s_2:s_3$ and $t_1:t_2:t_3$ are colinear iff $$\det\begin{pmatrix}r_1&r_2&r_3 \\ s_1&s_2&s_3 \\ t_1&t_2&t_3\end{pmatrix}=0.$$ Expressed in barycentric coordinates relative to $\triangle{ABC}$ and $\triangle{A'B'C'}$, $F$ is the identity map, so this condition obviously holds for the images of three colinear points as well.
This condition is pretty easy to derive: if the points $R$, $S$ and $T$ are colinear, then there’s some $\lambda$ for which $T=(1-\lambda)R+\lambda S$, that is, $T$ is an affine combination of $R$ and $S$. Since the barycentric coordinates of a point are the coefficients of a linear combination of the vertices of the reference triangle, this implies that the barycentric coordinates of $T$ are a linear combination of the coordinates of $R$ and $S$, which makes the above matrix singular.
Another way to approach this is to observe that since $m_A+m_B+m_C=1$, we can eliminate one of the coordinates: $$\begin{align} P &= m_AA+m_BB+m_CC \\&= m_AA+m_BB+(1-m_A-m_B)C \\&= m_A(A-C)+m_B(B-C)+C.\end{align}$$ and similarly $$\begin{align} F(P) &= m_AA'+m_BB'+m_CC' \\&= m_AA'+m_BB'+(1-m_A-m_B)C' \\&= m_A(A'-C')+m_B(B'-C')+C'.\end{align}$$ From these identities it’s not terribly difficult to show that the vertices of $\triangle{ABC}$ are mapped onto the respective vertices of $\triangle{A'B'C'}$ and that $F$ can be expressed in the form $p\mapsto Mp+b$, where $M$ is a nonsingular matrix (hint: the vectors $A-C$ and $B-C$ form a basis for $\mathbb R^2$). You could also use these identities to show that affine combinations of points are mapped to affine combinations of points, which then preserves lines, but the first proof above is an easier way to do that.