Often times I see authors having a definition for convex function whereby they say that the domain of $f$ is a convex set.
However, how is the domain of this function defined?
I am asking because in convex optimization, there is also the effective domain, which has a solid definition (https://en.wikipedia.org/wiki/Effective_domain)
$${\displaystyle \operatorname {dom} f=\{x\in X~:~f(x)<+\infty \}}$$
So is their domain the same as the effective domain? If not, what's the difference.

A convex set is a set $S \subseteq \mathbb{R}^n$ such that for all $x, y \in S$,
$$ tx + (1-t)y \in S \text{ for all } t \in [0,1] $$
The domain needs to be convex because the LHS $f(\theta \mathbf{x} + (1- \theta) \mathbf{y} )$ should be well-defined.
The effective domain is a different concept from this, and is relevant when infinity is being dealt with.
Here, $f: \mathbb{R}^n \to \mathbb{R}$; and $\mathbb{R}$ does not contain infinity.