You could use sth like
and then select f's fill color to be the backgroud color.
Of coures this only works as long as f<g for all x.
If this is not the case you could first do
upperCurve = max(f,g)
lowerCurve = min(f,g)
and then plot upperCurve and lowerCurve as stated above. If they are sufficiently high-res compared to your plot resolution it might be sufficient, however it wouldn't be "clean". Maybe there is another solution anyone can bring up...