Increasing continuous function preserves inequality for elements of $C^*$-algebra 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.
 A: 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.
A: Thanks to the hints by Eric Wofsey, I was able to solve this problem.
Here is a sketch of the full solution for those who also search for this question.
Let $\mathcal{A}$ be a $C^*$-algebra, and consider the $C^*$-algebra which is generated by the normal elements $a_1,...,a_n \in \mathcal{A}$. Denote this $C^*$-algebra by $C^*(a_1,...,a_n)$. In a similar fashion to the case where we have a single generated $C^*$-algebra, there exists an isometric *-isomorphism between $C^*(a_1,..,a_n)$ and the space $C(K)$ where $K \subset \mathbb{C}^n$ is a compact subset. Denote this isomorphism by $\rho$ and note that $\rho$ also has the following property $\rho(a_i) = z_i$ where $z_i(\lambda_1,..., \lambda_n) = \lambda_i$.
We trivially have $C^*(a_i) \subset C^*(a_1,...,a_n)$, and since there is an isometric $*$-isomorphism between $C^*(a_i)$ and $C(\sigma(a_i))$, any continuous function $f \in C(\sigma(a))$ can also be considered a continuous function in $C(K)$. 
With these ingredients, we are done. We can compile the steps of the proof as follows.
First show that since $b - a$ is a positive element of $C^*(a,b)$ then it is also a positive element of $C(K)$, note that here $K \subset \mathbb{R}^2$. Using the properties we earlier stated, we know that the corresponding continuous function to the element $b - a$ is given by $g(x,y) = y - x$. The positivity of $f(x,y)$ clearly implies that $y \geq x$.  
Using the continuous and increasing function $f : \mathbb{R} \to \mathbb{R}$, we can construct another continuous function $\tilde{f} : \mathbb{R}^2 \to \mathbb{R}^2$ which is naturally the mapping $(x,y) \mapsto (f(x), f(y))$.
Composing these two functions, we see that $h = g \circ f : K \to \mathbb{R}$ is a continuous function such that $h(x,y) = f(y) - f(x)$. Because $f$ is increasing this is a positive element. 
Finally, using the inverse of the initial $*$-isomorphism, we can show that the corresponding element in $C^*(a,b)$ for the function $h$ is in fact $f(b) - f(a)$, and since $h$ was a positive element that maps to $f(b) - f(a)$, then $f(b) - f(a)$ is also a positive element, as was required.
