I'm taking a course in optimisations and I read this
[A gentle introduction to opimisation]
My question is about the 3rd function in Example 1. Is it possible to write that as a linear (affine) function by declaring a new variable $$x_5=x_3*x_4$$ I understand that would add a new contraint but who cares? Is this now linear? (I don't think it's linear because constraint is not linear) Or is it affine but not linear

Yes! If you are willing to drop both $x_3$ and $x_4$ out of the picture, then yes, the problem
$$ f(x_1, x_2, x_5) = 3x_1 + x_2 - 6x_5 $$
is indeed linear. BUT, it is important to note that the problem now does not depend on neither $x_2$ nor $x_3$.
The problem in doing that is another one, once you optimize $f$ and find an optimal value of $x_5$, say $x_5 = 1$, you have now the issue $x_3 x_4 = 1$, which does not have a unique solution