Would I be right in saying you couldn't determine whether a function is surjective without any knowledge of its domain and codomain?
I mean say we had a function $f(x)=2x+3$.
Sure it's invertible right now so we could say the inverse is $f^{-1}(x)=\frac{x-3}{2}$
And then one may assume that because we have shown that this is invertible that we can now claim bijectivity and therefore subjectivity.
But I feel like this is a told bold a leap having no knowledge of the domain and codomain.
Suppose $f:[0,1]\rightarrow [3,5,7]$ then 7 is an element of the codomain that has no element to map to it from the domain.
Do you see what I mean ?
It is indeed somewhat hasty to declare this function bijective, but there are certain mathematical traditions that would help save your skin here. Particularly, $x, y, z$ variables are often used to indicate a real number, while $n, m$ may indicate an integer, $p, q$ being primes or factors, $a, b, c$ being particular indices of a small or arbitrary set, and so on. This shorthand is used very often to "pre-notate" the domain sets. Strictly speaking, the definition of a function is incomplete without a defined mapping. In your example, $f(x) = 2x+3$ really does not specify which domain and codomain it uses. It would be necessary to write in full $$f : \mathbb{R} \to \mathbb{R}$$ to indicate that $f$ is a function in the set of all functions mapping reals to reals, as opposed to the possible $$f : \{0,1\} \to \{3,5,6\}$$ function.
Here's the real, proper answer to what you mean, though: if you see a function defined around terms looking like $f$ or $x$ and you later found from your professor or proctor that you made a mistake because they "never showed the behavior of the function outside of [xyz abc] domain and codomain..." that you can write it off as an errata of the assignment for being in-concise and not a failure of your understanding.