Can g(n) be same for big O and omega notation for f(n)
If you write down $f \in O(g)$ and $f \in \Omega(g)$ then you clearly intend both instances of "$g$" to refer to the same function. Otherwise, it would be pretty confusing.

Note how this is equivalent to $f \in \Theta(g)$.

If, however, you write down $f \in O(n^2)$ and $f \in \Omega(n)$ and want to unfold both the definition of $O$ and $\Omega$, you'll have to instantiate two different "$g$"s. That is, you'd write

$\qquad c_1 g_1(n) \leq f(n) \leq c_2 g_2(n)$

for all $n \geq n_0$ for some $c_1, c_2 &gt; 0$ and $n_0 \geq 0$. Here, we know that $g_1 = n \mapsto n$ and $g_2 = n \mapsto n^2$.