Questions tagged [functions]

For elementary questions about functions, notation, properties, and operations such as function composition. Consider also using the (graphing-functions) tag.

A function $f$ defined on a set $X$ is an assignment of an element in some set $Y$ to each element of $X$. The set $X$ is called the domain of the function and $Y$ is called the codomain. The elements of $X$ are the inputs to the function and the elements of $Y$ are the potential outputs. For some input $x \in X$, its corresponding output in $Y$ is denoted $f(x)$. Not every element of $Y$ needs to be the output corresponding to some input though: the subset of $Y$ containing the elements that are an output of the function is called the range of $f$. When a function $f$ has domain $X$ and codomain $Y$, this is signified by writing $f \colon X \to Y$, and the assignments of inputs to outputs is signified by writing $f\colon x \mapsto f(x)$.

If you have a function whose codomain is the domain of another function, you can compose those two functions. In symbols if you have a function $f\colon X \to Y$ and a function $g \colon Y \to Z$, their composite is a function $g\circ f\colon X\to Z$ defined by the assignment $g\circ f\colon x \mapsto g(f(x))$.

For many examples of functions, the domain and range of the function are topological spaces, meaning that they are equipped with some notion of geometry. In this case we like to think of the function $f\colon X\to Y$ geometrically as the subset of the points $(x,f(x))$ in the topological space $X \times Y$. This subset of all the input-output pairs is called the graph of $f$.

Often mathematics textbooks will define a function slightly more rigorously than this though. They'll say that a function $f \colon X \to Y$ is a relation $R$ on the set $X \times Y$ such that

  1. For each $x \in X$ there is some $y \in Y$ such that $xRy$. Each input needs an output.
  2. If $xRy$ and $xRz$, then $y=z$. Each input needs exactly one output.

Here are a bunch of examples of functions:

  • Many examples of functions covered in elementary and high school have as their domain and codomain the real numbers $\mathbf{R}$. A basic example is the function $f \colon \mathbf{R} \to \mathbf{R}$ defined by the rule $f(x) = x^2$. Thinking geometrically, the graph of $f$ is the set of all points $(x,x^2)$ in the plane $\mathbf{R}^2$, and this forms a parabola. Note that while the codomain of this function is $\mathbf{R}$, the range consists of only the non-negative real numbers.

  • Here's a silly example. For any set $X$ we can define an identity function $\mathbf{1}_X$ with domain and codomain $X$ such that $\mathbf{1}_X \colon x \mapsto x$.

  • Let $W$ denote the set of all strings of letters of the alphabet, so like $\text{npr}$ or $\text{asdfasdf}$ or $\text{butt}$ for example. And let $\mathbf{N}$ denote the set of natural numbers. We can define a function $\ell\colon W \to \mathbf{N}$ such that $\ell$ assigns to each word it's length. So $\ell(\text{defenestration}) = 14$. Also $\ell(\text{butt})=4$.

  • Using the same set $W$ in the last example, let's define another function $\tau\colon W \to W$ such that $\tau$ "reverses" a word. So $\tau(\text{defenestration}) = \text{noitartsenefed}$, and $\tau(\text{butt}) = \text{ttub}$. A few neat properties of $\tau$ that deserve to be pointed out, $\tau \circ \tau = \mathbf{1}_W$, and also $\ell\circ\tau = \ell$.

33723 questions
7
votes
4 answers

If $g\circ f$ is injective and $f$ is surjective then $g$ is injective

Let $f:A\rightarrow B$ and $g:B\rightarrow C$ be functions, prove that if $g\circ f$ is injective and $f$ is surjective then $g$ is injective. I need advise or correction if something is incorrect with my proof. Thank you beforehand. We must show…
taue2pi
  • 1,147
  • 3
  • 13
  • 21
7
votes
3 answers

How to find inverse of a composite function?

I am stuck with this question, Let $A=B=C=\mathbb{R}$ and consider the functions $f\colon A\to B$ and $g\colon B\to C$ defined by $f(a)=2a+1$, $g(b)=b/3$. Verify Theorem 3(b): $(g\circ f)^{-1}=f^{-1}\circ g^{-1}.$ I have calculated $f^{-1}$,…
user2857
7
votes
1 answer

Why is the concept of a codomain useful?

I don't understand what the point is of specifying the codomain of a function. For example, if I ask, "Given the function f: $\Bbb R$ $\to$ $\Bbb R$, where $f(x) = x^2$, what is the image of f?", how is that any different from asking, "Given the…
Tyler
  • 287
7
votes
2 answers

Need mathematical function for "adding" 0.5 and 0.5 and getting 0.4

I'm looking for a mathematical function that would have the following attributes: Reasonably smooth -- continuous to the second or third derivative, say, for values greater than zero. Given two values 1.0 and 1.0 it produces 1.0 Given two values…
7
votes
2 answers

What is the simplest formula for activation / smooth step function?

I want smooth step function, which is changing from a to b while x changes from 0 to 1, and I want to control both slope and step location. Which is the simplest formula for this?
7
votes
2 answers

Is a constant as a function continuously differentiable?

Well, it may seem trivial, but I cannot find it on google. Is a constant function continuously differentiable, of all orders? Thank you.
Jie Wei
  • 425
7
votes
4 answers

Terminology - domain, codomain, image, and why no "pre-image".

If a function $f$ is defined as $$f:X\to Y$$ We say the domain is $X$, and the codomain is $Y$. However, it seems the image is distinct from codomain, and only coincides with $Y$ if $f$ is surjective. Question 1: Why is there this distinction? Why…
Penelope
  • 3,147
7
votes
2 answers

What is the Range of the function?

Q: Find the range and domain of the function $$f(x) = \sqrt{1-e^{x+2}}?$$ I've found the domain, which is $x \le -2$ by solving the inequality $1-e^{x+2} \ge 0$. I've tried to find the range by taking the inverse of $f$, which gives me $f^{-1} =…
John Fei
  • 81
  • 4
7
votes
4 answers

If a function is not defined at a point then will its inverse be defined at that point?

I have a function $y=\frac{x-2}{x-3}$ clearly the function is not defined at $x= 3$ But for its inverse $ \frac{3x-2}{x-1},$ can we say that it is defined at $x= 3$?
imposter
  • 532
7
votes
4 answers

Why is $D(x)$ periodic?

Let $D(x)$ be defined as $$D(x) = \begin{cases} 1 & \text{if $x$ is rational} \\ 0 & \text{if $x$ is irrational} \end{cases}$$ Why is $D(x)$ a periodic function? It certainly doesn't look like $\sin(x)$ or $x-\lfloor x\rfloor$. Then why do people…
7
votes
3 answers

Prove that between two roots of $f(x)$ there is a root of $g(x)$

Let $f(x),g(x)$ be differential functions, and $f'(x)g(x)\neq f(x)g'(x)$ for all $x\in\mathbb R$. Prove that between two roots of $f(x)$ there is a root of $g(x)$. I guess this has to do with Rolle's theorem. I saw that when $f'(x)=0$, $g(x)\neq0$…
Harold
  • 711
7
votes
2 answers

Concavity of max of two concave functions

I would like to check whether max(f(x),g(x)) is concave when f(x) and g(x) are concave on R to R. I can think it as verbally but couldn't find a mathematical solution. Any help is appreciated. Cheers!
7
votes
2 answers

functional equation $f(f(x))=af(x)+bx$

Let $0
tong_nor
  • 3,994
7
votes
2 answers

$f(f(f(x))) = x$. Prove or disprove that f is the identity function

Let $f$ be a continuous function on $\mathbb R$ satisfying the relation $$f(f(f(x))) = x\ \text{for all}\ x \in \mathbb R$$ Prove or disprove that $f$ is the identity function. I tried taking the derivative. From the derivative, I'm not sure about…
7
votes
5 answers

Does $\sin(t)$ have the same frequency as $\sin(\sin(t))$?

I plotted $\sin(t)$ and below it $\sin(\sin(t))$ on my computer and it looks as if they have the same frequency. That led me to wonder about the following statement: $\sin(t)$ has the same frequency as $\sin(\sin(t))$ Is this statement true or…