Linear functions over vector spaces vs those from analytic geometry We can think of the reals as an infinite dimensional vector space over the field of rationals. Let's take two such vectors, $1$ and $x$, where $x$ is irrational. Per miniature 12 of [1], it is possible to define a linear function, $f$ over this vector space such that $f(1)=1$ and $f(x)=-1$ because the two vectors, $1$ and $x$ are linearly independent. Also, by the definition of linear functions over vector spaces:
$$f(u+v) = f(u)+f(v)\tag{1}$$
For any scalar $\alpha$,
$$f(\alpha u) = \alpha f(u)\tag{2}$$
Setting $\alpha=0$ in (2) we get $f(0)=0$.
Now, if I switch back to thinking of the real numbers not as vectors, but as plain numbers (scalars), I can still define a linear function, $g$ on them. The form of this linear function must be: $g(u)=\mu u+\nu$.
However, I now can't simultaneously satisfy the requirements $g(0)=0$, $g(1)=1$ and $g(x)=-1$.
But the real numbers are still the same real numbers. We're merely thinking of them differently in the two formulations. How come thinking of them as infinite dimensional vectors allows us to define functions on them that are impossible when we think of them as scalars?
Note that I asked a very similar question here: Product of linear function applied to the two sides of a rectangle is supposed to equate to the sum across its tiles.. But at that point, I didn't even understand "the what" of the proposal and the answer there helped me sort it out. But having understood "the what", I'm still having trouble with "the why" and hence this new question.

[1] Thirty-three Miniatures: Mathematical
and Algorithmic Applications of
Linear Algebra
 A: What is often called a linear map in high school is not actually a linear map in linear algebra. The function $g : \mathbb{R} \to \mathbb{R}$, $u \mapsto \mu u + \nu$ is a linear map if and only if $\nu = 0$ (this is clearly necessary as we need $g(0) = 0$). Moreover, every $\mathbb{R}$-linear function $g : \mathbb{R} \to \mathbb{R}$ is of the form $g(u) = \mu u$ for some $\mu \in \mathbb{R}$.
As $\{1, x\}$ is a linearly independent set in the $\mathbb{Q}$-vector space $\mathbb{R}$, there is a $\mathbb{Q}$-linear map $f : \mathbb{R} \to \mathbb{Q}$ such that $f(1) = 1$ and $f(x) = -1$. Note that $f$ has codomain $\mathbb{Q}$ and is $\mathbb{Q}$-linear, as opposed to having codomain $\mathbb{R}$ and being $\mathbb{R}$-linear. This is why $f$ is not necessarily of the form $u \mapsto \mu u$. In fact, the only $\mathbb{Q}$-linear map $\mathbb{R} \to \mathbb{Q}$ of this form is the zero map. To see this, first note that $1 \mapsto \mu \in \mathbb{Q}$, and $\sqrt{2} \mapsto \mu\sqrt{2} \in \mathbb{Q}$. Since $\mu$ is rational and $\sqrt{2}$ is irrational, we must have $\mu = 0$.
A: The difference lies in the definition of linear. In the first case, we mean that the function $f$ is linear as a function on a vector space, whereas in the second case you mean linear over the real numbers as a field. These are not the same thing. These definitions are not related, in the sense that linearity in the vector space interpretation does not imply linearity as an analytic function. (the converse does hold, of course). That is to say, As Michael Albanese points out, $f$ is $\mathbb Q$-linear over $\mathbb R$, but $f$ is not $\mathbb R$-linear.
There is no contradiction in your observations, because the scalar $\alpha$ must come from $\mathbb Q$. So one cannot derive, for example, that $f(1)=1/xf(x)=-1/x$, since here we take $\alpha$ to be irrational. More generally, $f$ will appear to be discontinuous over the reals.
It helps to see that your $f$ is not yet defined everywhere, because you have only given its on two of uncountably many independent vectors. For every independent point $x^\prime$ where you give a value of $f$, you define its value on the points $x^\prime\mathbb Q$.
You can take your observation and make many more pathological-seeming functions. For example, you can take uncountably many relatively irrational points $x_1,\ldots$ and then say that $f(1)=1$ and $f(x_i)=-x_i$ for all $i$. This will produce a function which has value $$f(x)=\begin{cases}x & x \text{ is rational} \\-x & x \text{ is irrational}\end{cases}$$
