Can the function $x\mapsto \frac1{x+1}$,be defined over $\mathbb R$? I am getting confused between what it means for a function to be defined over a domain and continuity.
My understanding is that a function being defined over an interval or domain means that all the elements of domain should have only one image in co-domain (it's not necessary for the image to be unique).
This means a function like $x\mapsto \frac1{x+1}$ from $\mathbb R\to\mathbb R$, which clearly is discontinuous at $x=-1 \in\mathbb R$, can still be defined over domain $\mathbb R$ because $-1$ has only $1$ image i.e $\infty$ and its co-domain is also $\mathbb R=(-\infty, \infty)$.
Am I right in my understanding , or do we need to restrict the domain to $\mathbb R\setminus\{-1\}$?

First: $\infty$ and $-\infty$ are not real numbers, they are not elements of $\mathbb{R}$.
Second: to avoid confusion it is helpful to use precise language when talking about maps or functions. A map $f:A\rightarrow B$ consists of the domain $A$, the co-domain $B$ and a procedure (for example a formula) to assign an element $f(a)\in B$ to an element $a\in A$.
Third: If you want to use the formula $f(x):=\frac{1}{x+1}$ to assign a real number $f(x)$ to a real number $x$, then you can do this only for $x\in\mathbb{R}\setminus\{-1\}$, which will give you a function
$f:\mathbb{R}\setminus\{-1\}\rightarrow\mathbb{R}$.
However you can extend the function $f$ to a function $g:\mathbb{R}\rightarrow\mathbb{R}$ for example by defining $g(x):=f(x)$ for $x\neq-1$ and $g(-1):=0$. Of course the function $g$ is not continous at $-1$.
You can now see that your statement "$f$ is not continous at $-1$" is without meaning, because $f$ is not defined at $-1$. A meaningful statement is "$f$ cannot be extended continously to the whole of $\mathbb{R}$".
