The algebra here is quite straight forward.
We check visually with mapping diagrams and graphs for.$f\circ g$ and
$g
\circ f$.
Select the point x in the mapping diagram to move the point
by mouse or use the scroll up or down key to move by
increments.