Yes, I think you got the idea. I’ll just rephrase it slightly here.
When we have something like f(5x^2) = …, that tells us how the function f acts on the whole expression 5x^2, not just on x. Our goal is to find a general rule for what f does to any input; we often call that input t, u, or x.
In other words, whatever f does to 5x^2, it will do the same to any expression of the same form, like 5t^2. So if we can find the rule connecting the input to the output, we can replace 5x^2 with a single variable u (or t), find f(u), and then rename the variable to get f(x).
Generally, when we write something like f(g(x)), it means we’re applying f to whatever the inner function g gives us. The rule that defines f doesn’t depend on the letter used; it depend only on the input value. So whatever f does to g(x), it will also do to g(t) or g(u), as long as the function g itself is the same. In other words, f(g(x)) and f(g(t)) follow the same rule, so the variable name is just a label for the input.