Briefly, the way you make sense of this is by being consistent with notation and being aware of definitions. f is a function. f(x) is not a function. f(x) is an element of the range. Unfortunately, I'm sure growing up your teachers probably referred to f(x) as being the function. If you just simplify the function composition and clearly label objects, I'm pretty sure you won't have this kind of confusion. It really shouldn't be this complicated.
While we're at it, it's probably not the best idea to represent derivatives as fractions either (for the sake of notational consistency). But that notation will never die.
While we're at it, it's probably not the best idea to represent derivatives as fractions either (for the sake of notational consistency). But that notation will never die.