You can use scatter3. To that end, you can create a matrix containing in each row the coordinates of each point and the value of f or g. Suppose the matrix is called M and the columns are the x, y, z values and the function. Then write:
scatter3(M(:,1),M(:,2),M(:,3),5,'o',M(:,4))
and you will get each point with a different colour representing the value of f or g. Write:
scatter3(M(:,1),M(:,2),M(:,3),M(:,4),'o')
and you will get each point with a different size representing the value of f or g. Write
scatter3(M(:,1),M(:,2),M(:,3),M(:,4),'o',M(:,5))
and you will get the points with different sizes and different colours representing both f and g.
Whether it represents f and/or g depends on what you put in the columns 4 and 5.
Just in case, check the usage of scatter3 in the Matlab help. I might have messed up the order of the last inputs.
Hope this helps.