If you define $\mathcal{O}(\mathbb{A}^1_{\mathbb{R}})$ as the set of functions with the following property (P1):
P1. $f: \mathbb{R}^2 \rightarrow \mathbb{R}$ with the property that for any point $p\in \mathbb{R}^2$ there is an open subset $U(p)\subseteq \mathbb{R}^2$ and two polynomials $p(x),q(x)\in \mathbb{R}[x]$ such that the restriction $f_{U(p)}$ of $f$ to $U(p)$ satisfies $f_{U(p)}=\frac{p(x)}{q(x)}$,
then it follows (as you noted) the function $\frac{1}{x^2+1}$ is a regular function on $\mathbb{R}^2$. Hence $\mathcal{O}(\mathbb{A}^1_{\mathbb{R}})\neq \mathbb{R}[x]$. If $z=a+ib \in \mathbb{C}$ with $b\neq 0$, it follows
the polynomial $p_z(x):=(x-z)(x-\overline{z})=x^2-2ax+a^2+b^2\in \mathbb{R}[x]$ is an irreducible polynomial - it has no real roots.
Hence if you use definition P1 to define the ring of regular functions, it follows the function $f(x):=\frac{1}{p_z(x)}$ is a regular function. If $S\subseteq A:=\mathbb{R}[x]$ is the set of polynomials on the form $p(x):=\prod_{z_i\in \mathbb{C}-\mathbb{R}} (x-z_i)(x-\overline{z_i})$ it follows $S$ is a multiplicatively closed subset, and the ring of fractions $S^{-1}A$ is a sub-ring of $\mathcal{O}(\mathbb{A}^1_{\mathbb{R}})$. Hence with definition P1 it follows the ring $\mathcal{O}(\mathbb{A}^1_{\mathbb{R}})$ is much larger than $A$.
Question: "The regular functions on $\mathbb{A}^n$ are exactly the polynomials in n variables [...], which I only agree with for K
algebraically closed and not in the case I've shown above."
Answer: You want (for many reasons) to recover the polynomial ring $\mathbb{R}[x]$ as the ring of global sections of the structure sheaf. This problem is "solved" by the affine spectrum $Y:=Spec(\mathbb{R}[x])$. What you define above is a "sheaf of rings" on the real algebraic variety $\mathbb{A}^1_{\mathbb{R}}$ in the sense of "real algebraic geometry", and this sheaf differ from the sheaf defined using the affine spectrum in the sense of Hartshornes book "Algebraic geometry". The topological space of the variety $X:=\mathbb{A}^1_K$ you consider above is the set of real numbers $r\in \mathbb{R}$. The topological space of $Y$ consists of all real numbers plus the set of all maximal ideals in $A:=\mathbb{R}[x]$ with residue field the complex numbers. Hence the two topological spaces differ. Your space $X$ is by definition the set of rational points $Y(K)$ with the induced topology.
Note: There is nothing "wrong" with the ringed space $(X, \mathcal{O}_X)$ - it has properties different from $Y$. In real algebraic geometry it follows projective space $\mathbb{P}^n_K$ may be realised as a real affine algebraic variety - there is a closed embedding into real affine space. Moreover any real projective variety is affine. The reason for this is that the structure sheaf has more local sections, as you have observed in your comment above. Hence there are "more maps". This does not happen with the Hartshorne definition: You cannot construct a closed embedding of $Proj(k[x_0,..,x_n])$ into
affine space $Spec(k[y_1,..,y_d])$.
As an example: The global section $s(x):=\frac{1}{p_z(x)}$ for $z\in\mathbb{C}-\mathbb{R}$ is a unit - the polynomial $p_z(x)$ is non-zero on $\mathbb{R}$, and with your definition of "regular map" it follows $s(x)$ is a global section - it lives in $\mathcal{O}_{\mathbb{A}^1_K}(\mathbb{A}^1_K)$. The function $s(x)$ is not a global section of $\mathcal{O}_Y(Y)\cong \mathbb{R}[x]$.
Real algebraic varieties are relevant for people studying complex algebraic varieties and their topology. You may for any complex projective manifold $X \subseteq \mathbb{P}^n_{\mathbb{C}}$ construct the Weil restriction $W_{\mathbb{C}/\mathbb{R}}(X)$. If $dim(X)=d$ it follows $dim(W_{\mathbb{C}/\mathbb{R}}(X))=2d$ and $W_{\mathbb{C}/\mathbb{R}}(X)$ is a smooth scheme over $\mathbb{R}$ - the "underlying" real algebraic variety of $X$. The variety
$W_{\mathbb{C}/\mathbb{R}}(X)$ has the same topology as $X$ and you may realize $W_{\mathbb{C}/\mathbb{R}}(X)$ as a real affine algebraic variety. Hence the "underlying" real algebraic variety of $X$ is affine. Moreover: Any real affine algebraic variety may (topologically) be realized as a hypersurface. Hence if you study the topology of $X$ it follows there is a real affine hypersurface $Z(f)$ with the same topology as $X$ (here I am extremely "vague").
You find this discussed here:
https://math.stackexchange.com/posts/3957121/edit
and here:
Different definitions of regular map (between affine varieties)?