# Functions, Domains, And equality

1. Jul 24, 2010

### L Huyghe

1. The problem statement, all variables and given/known data

Given an example of two different functions f and g, both of which have the set of real numbers as their domain, such that f(x)=g(x) for every rational number.

2. The attempt at a solution

I have yet to figure a way to approach this problem. Since it appears as though they are only equal for rational numbers.

2. Jul 24, 2010

### hgfalling

It doesn't seem from the problem statement that they are only equal for rational numbers, but in that case, why not just use that in the function definitions? You could define a function that is 0 for all rational numbers and 1 at all irrational numbers, for example. Then come up with a second function that meets the problem criteria.

3. Jul 24, 2010

### L Huyghe

You are right in doesn't necessarily state that all they are not equal in terms of irrational numbers in their domain

4. Jul 25, 2010

### HallsofIvy

That is the approach! Define f to be whatever you want, then define g to be that same function on the rationals, but something else on the irrationals. Remember that a "function" does not necessarily mean a single "formula". Such a function cannot be "continuous" anywhere. I do wonder why such a problem would be posted under "precalculus". Since you are the same person who posted the "find f(x) that maps (0, 1) to [0, 1]", what course are these for?

5. Jul 25, 2010

### Hurkyl

Staff Emeritus
The problem does say that f and g are different. So they have to have a different value at one point, at least.

6. Jul 25, 2010

### Hurkyl

Staff Emeritus
Don't people generally learn the basics of functions in a precalculus class, or earlier?

It sounds like he just did the chapter on piecewise-defined functions. (Tip to opening poster: information such as what lesson you have just learned can be useful both to give you ideas, and to help those who want to help you)

7. Jul 25, 2010

### L Huyghe

Sorry about that, It's probably a good idea to give some more background knowledge about myself. It's not for a course, Just reading precalculus in advance for next year, and I found these problems in the book. I know about piecewise function, but they have yet to be clearly defined in the book yet. These question are in the intro to functions section.

*Also I am still having trouble answering original question, It would be great if u could give me an example. Sorry If i was vague before.

8. Jul 25, 2010

### hgfalling

$$f(x)=\left\{\begin{array}{cc}0,&\mbox{ if } x \in \matbb{Q} \\1, & \mbox{ otherwise }\end{array}\right.$$

$$g(x)=\left\{\begin{array}{cc}0,&\mbox{ if } x \in \matbb{Q} \\14, & \mbox{ otherwise }\end{array}\right.$$