We have that $g(x) = \inf_{u\in [0,1]\cap\mathbb{Q}} f(x,u)$, because $f(x,u)$ is continuous. This shows immediately that $g(x)$ is Borel, in fact Baire-1 because it is the pointwise limit of continuous functions (because $\mathbb{Q}$ is countable).

In general, any upper semi-continuous function $g(x)$ is Borel, in fact Baire-1. To see this, note first that each level set $\{x:g(x)\geq c\}$ is closed, hence $\{x:g(x)>c\}$ is an $F_\sigma$-set, $\{x:a<g(x)<b\}$ is the intersection of two $F_\sigma$'s which is $F_\sigma$, hence the inverse image of any open set is a countable union of $F_\sigma$'s which is $F_\sigma$.