# Graphic determination of the domain and of the image

To determine the domain and the path of a function from its graph, we will concentrate on all the represented pairs of numbers $$(x, y)$$.

• A real number $$x = a$$ belongs to the domain of a function if and only if the vertical straight line $$x = a$$ is in the graph of the function at some point.
• A real number $$y = b$$ belongs to the image of a function if and only if the horizontal straight line $$y = b$$ cuts the graph of the function at some point.

Determine the domain and the image of the following function $$f$$ defined by parts:

We observe that the graph of the function is not continuous. To the left of $$0$$ the function is a straight line with slope equal to $$-1$$.

At $$x=0$$ the function takes the value $$1$$. While when $$x$$ is greater than zero but smaller than $$2$$, the slope is $$1$$.

Finally when $$x$$ is greater than $$3$$ the slope is $$0$$, and $$y$$ always takes the value $$1$$.

This way, the domain will be the set of the real numbers except fort the part in which the function is not defined, which is given by the interval $$[2, 3)$$.

Therefore, $$Dom (f) = \mathbb{R}-[2,3)=(-\infty,2) \cup [3,+\infty)$$.

On the other hand we can realize that the path of the function is the set of the real ones $$x> 0$$.

Then, $$Im (f) = (0,+\infty)=\mathbb{R}^+$$

Finally, we present the analytical expression of the function:

$$f(x)=\left\{ \begin{array}{rcl} -x & \mbox{ if } & x < 0 \\ 1 & \mbox{if} & x=0 \\ x & \mbox{if} & 0< x < 2 \\ 1 &\mbox{if} & x\geq 3 \end{array} \right.$$\$