Let $\mathcal{A}$ be a $C^*$ algebra and suppose that $a,b \in \mathcal{A}$ are self-adjoint and commuting elements that satisfy $$a \leq b \ .$$ If $f$ is an increasing continuous function on $\mathbb{R}$, then I would like to show that $$ f(a) \leq f(b) \ .$$ I do not know how to even start solving this problem. A naive idea would be to approximate the continuous function $f$ by a sequence of monotone increasing polynomials $\{ p_n \}_{n \in \mathbb{N}}$, then I would like to attempt to show that for any monotone increasing polynomial, we have $$ p_n(a) \leq p_n(b) \ .$$ Now, somehow applying the uniform convergence in the context of positive elements of the algebra could give me my result.
One thing that I considered was that since $a$ and $b$ are commuting and self-adjoint, the algebra generated by these two elements and the identity will be an abelian $C^*$-algebra. However, I do not really see how to utilize this fact here.
I guess my biggest problem is that I don't really know how to manipulate the spectrum of $f(b) - f(a)$ and I don't really have any intuition as to why I would expect this result to be true in such generality.
Any help would be greatly appreciated, I would prefer hints to full solutions, or sketches to proofs which I could fill in myself.
Hint: Let $B$ be the subalgebra generated by $a$ and $b$. Since, as you note, it is abelian, it is isomorphic to $C(X)$ for some space $X$. Moreover, the continuous functional calculus on an algebra of the form $C(X)$ is just given by composition: if $a$ corresponds to the function $g:X\to\mathbb{R}$, then $f(a)$ corresponds to the function $f\circ g:X\to\mathbb{R}$ (if you're not familiar with that fact, prove it!). When interpreted in terms of functions on $X$, then, your statement is easy to prove.