I have to find the equation of the affine transformation of the affine plane $A_2$ that (1) fixates the line $s: x + y - 1 = 0$ and (2) such that $A(Q)=P$, where $Q(1,2)$ and $P(2,1)$.
How should I approach this problem? I have troubles with condition (1) in particular.
Use the translation of the plane that moves point $Q$ to point $P$. If you check, you will see that this transformation will leave the line in place. This is because the value of $f(x,y)=x+y-1$ is equal for points $P$ and $Q$.
If you need a fuller proof that this translation works:
The translation can be written as $(x,y)\to (x+1,y-1)$. So we see that for the point $(x',y')$, the image of $(x,y)$, we have $x'=x+1$ and $y'=y-1$. If we choose a point $(x,y)$ on line $s$ we have
$$x'+y'-1=(x+1)+(y-1)-1=x+y-1=0$$
so the image $(x',y')$ is also on line $s$, and $s$ is fixed.
Note that there are other affine transformations that work. One example is taking the transformation above then doing a reflection about the line that goes through point $P$ and is perpendicular to line $s$. The one I gave above is just the simplest.
I realized this morning that your question is ambiguous. I gave an answer that fixes the line $s:x+y-1=0$ as a whole, but the question may have wanted an affine transformation that fixes each point on the line. The latter is more restrictive: there is only one affine transformation that does that.
To find an affine transformation, we just need to know three non-collinear points and their images. We already know point $Q(1,2)$ and its image $P(2,1)$. Now let's choose two points on line $s:x+y-1=0$. Two easy points are $A(1,0)$ and $B(0,1)$, which are their own images.
A two-dimensional affine transformation is defined by the constants $a,b,c,d,e,f$ and is given by
$$f\left(\begin{bmatrix}x \\ y \end{bmatrix}\right) =\begin{bmatrix}a & b \\ c & d \end{bmatrix} \cdot\begin{bmatrix}x \\ y \end{bmatrix} +\begin{bmatrix}e \\ f \end{bmatrix}$$
So all you need to do is to solve the six linear equations in the six unknowns $a,b,c,d,e,f$ coming from these three matrix equations:
$$\begin{bmatrix}2 \\ 1 \end{bmatrix} =\begin{bmatrix}a & b \\ c & d \end{bmatrix} \cdot\begin{bmatrix}1 \\ 2 \end{bmatrix} +\begin{bmatrix}e \\ f \end{bmatrix}$$
$$\begin{bmatrix}1 \\ 0 \end{bmatrix} =\begin{bmatrix}a & b \\ c & d \end{bmatrix} \cdot\begin{bmatrix}1 \\ 0 \end{bmatrix} +\begin{bmatrix}e \\ f \end{bmatrix}$$
$$\begin{bmatrix}0 \\ 1 \end{bmatrix} =\begin{bmatrix}a & b \\ c & d \end{bmatrix} \cdot\begin{bmatrix}0 \\ 1 \end{bmatrix} +\begin{bmatrix}e \\ f \end{bmatrix}$$
From this I get
$$a=\frac 32,\ b=\frac 12,\ c=-\frac 12,\ d=\frac 12,\ e=-\frac 12,\ f=\frac 12$$
So your desired affine transformation is
$$f\left(\begin{bmatrix}x \\ y \end{bmatrix}\right) =\begin{bmatrix}\frac 32 & \frac 12 \\ -\frac 12 & \frac 12 \end{bmatrix} \cdot\begin{bmatrix}x \\ y \end{bmatrix} +\begin{bmatrix}-\frac 12 \\ \frac 12 \end{bmatrix}$$
or, written differently,
$$f(x,y)=\left(\frac 32 x+\frac 12 y -\frac 12, -\frac 12 x+\frac 12 y +\frac 12 \right)$$