# Domain, codomain, range and image of a function

I am confused by the concept of domain, range, co-domain and image set of a function.

For example, I have $$f:[0,5] \ \to [\frac{1}{5}, \infty]$$, defined by $$f(x) = \frac{1}{x}$$.

I would like to ask the questions:

1. What is the domain of $$f$$ ? Is it $$[0,5]$$ or $$(0,5]$$ ?
2. Is the range, codomain and image of $$f: [\frac{1}{5}, \infty]$$ or $$\mathbb{R}$$ ?
3. What is the condition for 2 functions $$f$$ and $$g$$ to be equal ?

Thank you very much!

P/s: This question on mathexchange relates but not fully satisfies my concern
Domain, Codomain, Range, Image and Preimage

• Your example abuses the standard notation: writing $f:X\to Y$ means the domain is $X$, and that $f$ is a function - your "rule" doesn't apply to every point of the domain so you've not yet said what function you have in mind. Commented Feb 26, 2021 at 16:59
• @ancientmathematician: thanks for your comment! Could you please be more specific, I don't clearly understand your point ? Commented Feb 26, 2021 at 17:04
• We'd have to begin by you answering a question: what precisely is your definition of a function? And as you've flagged the question "real-analysis" what does the symbol "$\infty$" signify? Commented Feb 27, 2021 at 7:28

Domain D is set of all real values of $$x$$ for which the function takes real,finite and unique value. Range R is all values taken by the function over all the $$x$$ values of the domain. A set larger than the the range is co-domain C. Infinity is never included in D and R. So in your example $$D=(0,5], ~~R=[1/5,\infty),~~ C= \Re (Real)$$
Image is $$f(a)$$, the value of function at $$x=a$$ when $$a \in D$$. Set of all images is nothing but the range R. $$x=a$$ can also be called pre-image of $$f(a)$$.
• Thanks for your answer! Could you add some explanations about the term "image" of $f$ ? Commented Feb 26, 2021 at 17:10