I would work through this problem as follows:
$$\langle x| s \rangle = \int x \cdot p(x|s) dx$$
I think this is different to what you've done, you seem to be integrating against s but any expression for $\langle x| s \rangle$ must have explicit dependence on s so you can't have s dependence integrated out
Then you can use Bayes to write this as
$$\langle x| s \rangle = \int x \cdot \frac{p(s|x)p(x)}{p(s)} dx$$
where I just used $p$ to generically denote "the pdf of", as per the usual Bayes' theorem notation. By your definitions, $p(x)=f(x)$ and $p(s|x)=g(x;s)$
Also, by the chain rule of probability,
$p(s) = \int p(s|x)p(x)dx$ so putting this all together
$$\langle x| s \rangle = \frac{\int x \cdot g(x;s)f(x)dx}{\int g(x;s)f(x)dx}$$
In your example, $f(x)$ is a uniform between $[0,1]$ and $g(x;s)=x^{s}(1-x)^{1-s}$, and thus
$$\langle x|s\rangle = \frac{\int _{0}^{1}x^{s+1}(1-x)^{1-s}}{\int _{0}^{1}x^{s}(1-x)^{1-s}}=\frac{\beta(s+2, 2-s)}{\beta(s+1, 2-s)}$$
(where $\beta$ denotes the beta function)
this simplifies to $\frac{s+1}{3}.$
Note that this gives you the same values you got, but I think you're somehow confusing x and s. s can take the values 0 or 1. If the coin flip comes up 0, chances are its probability of coming up heads (the result of your prior draw from the uniform) was lower than 0, and indeed the expectation is 1/3 and conversely it's 2/3 if the coin flip comes up 1. Note that $\langle x|s \rangle$ is not a function of x, as it's an expectation value of the random variable x, all x-dependence has been integrated out. It explicitly depends on s, and coincidentally in this example, there are two possible values of s and if you sum the values for $s=0$ and $s=1$ you get 1, but this is a coincidence. This is not a distribution over s, it isn't (generally speaking, albeit in this case it is) normalised wrt s.
So I think you're broadly on the right track but just need to make sure you're not confusing x and s. One thing that I don't think helped is that you've used this notation $g(x;s)$ to denote $p(s|x)$, which really I think you should be denoting as $g(s;x)$, or ideally $p(s|x)$. The notation $g(s;x)$ to me implies a pdf/pmf over s, with parameters x (and thus normalised wrt s). In your simple example, this made sense as $x$ was literally the parameter value, but more generally it might be the case that $s$ is distributed according to parameters $\theta$, and $\theta$ is actually a function of x, in which case the distribution of s still depends on x but isn't directly parametrised through it, hence me saying using $p(s|x)$ is probably more helpful notation in terms of keeping track of what's going on.