I am trying to verify example 1.24 in Axler's Linear Algebra Done Right. He defines the notation $F^S$ to denote the set of all functions from $S$ to a field $F$, where $F$ is $\mathbf{R}$ or $\mathbf{C}$.
If $S$ is a nonempty set, then $F^S$ (with the defined addition and scalar mltiplication) is a vector space over $F$.
The additive identity of $F^S$ is the function $0: S \to F$ defined by $0(x) = 0$.
For all $f \in F^S$, the additive inverse of $f$ is the function $-f: S \to F$ defined by $(-f)(x) = - f(x)$ for all $x \in S$.
Here is my solution.
By definition, $$F^S := \{f: f: S \to \mathbb{R}, \; S \neq \emptyset\}.$$ The given addition on $F^S$ is $$(f+g)(x) = f(x) + g(x)$$ for any $x \in S$. By definition, this takes inputs in $S$ and produces two outputs, $f(x)$ and $g(x)$, in $F$, and since $F$ is closed under addition, $f(x) + g(x) \in F$. Hence, $f+g \in F^S$. Similarly, by definition, scalar multiplication is given by $$(\lambda f)(x) = \lambda f(x)$$ for $\lambda \in F$ and $f \in F^S$. By definition, $\lambda f$ takes intputs in $S$. Since $f$ maps to $F$, $f(x) \in F$. By closure of $F$ under scalar multiplication, $\lambda f(x) \in F$, so the scalar multiplication is likewise valid.
Now, it suffices to check the remaining properties of a vector space.
Commutativity: Let $f, g \in F^S$. For any $x \in S$, $$(f + g)(x) = f(x) + g(x) = g(x) + f(x) = (g + f)(x),$$ so addition on $F^S$ is commutative, which follows from commutativity under addition in $F$.
Associativity of addition: This follows from associativity in $F$. Let $f, g, h \in F^S$. Then, for any $x \in S$,
$$((f + g) + h)(x) = (f+g)(x) + h(x) = (f(x) + g(x)) + h(x) = f(x) + (g(x) + h(x)) = (f + (g+h)(x),$$ so addition in $F^S$ is associative.Associativity of scalar multiplication: let $\alpha, beta \in F$. For any $f \in F^S$ and $x \in S$, we have $$((\alpha \beta)(f))(x) = (\alpha \beta) f(x) = \alpha (\beta f(x)) = \alpha ((\beta f)(x)) = (\alpha (\beta f))(x)$$ by associativity in $F$. Additive identity. We consider the defined function $0(x) = 0$. For any $f \in F^S$ and $x \in S$, we have $$(f + 0)(x) = f(x) + 0 = f(x)$$ by the additive identity in $F$. So $0(x)$ is indeed the identity in $F^S$.
Additive inverse: Given $f \in F^S$, take $-f: S \to F$ given by $(-f)(x) = -f(x)$. By closure under scalar multiplication, $-f \in F^S$. By the definition of addition, for any $x \in S$, we have $$(f + (-f))(x) = f(x) + (-f)(x) = f(x) + (-f(x)) = 0$$ by the additive inverse axiom in $\mathbb{F}$.
Multiplicative identity: For any $f \in F^S$ and $x \in S$, the definition of scalar multiplication gives $$(1f)(x) = 1f(x) = f(x)$$ by the multiplicative identity axiom in $\mathbb{F}$.
Distributive law: let $\lambda \in F$ and $f, g \in F^S$. First, for any $x \in S$, we have $$(\lambda (f + g))(x) = \lambda ((f+g)(x)) = \lambda (f(x) + g(x)) = \lambda f(x) + \lambda g(x)$$ by distributivity in $F$. So distributivity over addition of functions holds.
Finally, we prove distributivity over field addition. Taking $\alpha, \beta \in F$ and $f \in F^S$, for any $x \in S$, we have $$((\alpha + \beta)f)(x) = (\alpha + \beta)f(x) = \alpha f(x) = \beta f(x)$$ by distributivity in $F$.
Hence, $F^S$ is a vector space.
Looks good to me, but I think you forgot to prove that
$$(\alpha f)g = \alpha (fg)$$
where $\alpha$ is a scalar and $f,g$ are functions.