Suppose I have a set $B = \{n^2 + n + 1 : n \in \mathbf{N}\}$ and I want to define a function $g: B \rightarrow \mathbf{N}$ that only accepts as it's arguments numbers of the form $n^2 + n + 1$ for $n \in \mathbf{N}$ and returns $n$. How would I say that in function notation when writing a proof? Would this be correct:
"Let $g: B \rightarrow \mathbf{N}$ be the function defined by $g(n^2 + n + 1) = n$."
That doesn't look right.
You can use $g(m)= \frac{\sqrt{4m-3}-1}{2}$, if $m$ is always of the form $n^2+n+1$. This gives $g(m)=n$.