5

Say I have $f=x^2$ (surjective) and $g=e^x$ (injective), what would $f\circ g$ and $g\circ f$ be? (injective or surjective?)

Both $f$ and $g : \mathbb{R} \to \mathbb{R}$.

I've graphed these out using Maple but I don't know how to write the proof, please help me!

ViktorStein
  • 4,838
meiryo
  • 875
  • 4
    Is $f$ surjective? What is the codomain? – lhf Mar 21 '11 at 14:18
  • What did you want to prove? – AD - Stop Putin - Mar 21 '11 at 15:25
  • Yes, f is surjective (horizontal line test). I want to know what kind of function f∘g and g∘f would be. – meiryo Mar 21 '11 at 22:19
  • Are you sure you want $f:\mathbb{R} \to \mathbb{R}$ and not $f: \mathbb{R} \to [0,\infty)$? It is surjective onto the latter but not onto the former. – t.b. Mar 21 '11 at 23:01
  • For a function to be surjective, it must intersect each horizontal line in at least one point. Doesn't that mean f is surjective when R -> R? – meiryo Mar 21 '11 at 23:25
  • 1
    Yes, the horizontal line test works for $[0,\infty)$ but how about the horizontal lines below the $x$-axis? By the way: I'm not seeing that you're answering me in a comment unless you add @Theo somewhere. – t.b. Mar 21 '11 at 23:40
  • @Theo, okay I understand now thanks! – meiryo Mar 22 '11 at 01:36

3 Answers3

9

Examples to keep in mind for questions like this:

  • Take $X = \{1\}$, $Y = \{a,b\}$, $Z =\{\bullet\}$. Let $f\colon X\to Y$ be given by $f(1)=a$, and $g\colon Y\to Z$ given by $g(a)=g(b)=\bullet$.

    Then $g\circ f\colon X\to Z$ is bijective; note that $f$ is injective but not surjective, and that $g$ is surjective but not injective. So, injectivity of the composite function cannot tell you anything about injectivity of the last function applied; and surjectivity of the composite function cannot tell you anything about surjectivity of the first function applied.

  • As above, but now take $Y = \{a,b\}$, $Z=\{\bullet\}$, and $W=\{1,2\}$. Let $g\colon Y\to Z$ be given by $g(a)=g(b) = \bullet$, and $h\colon Z\to W$ be given by $h(\bullet) = 1$. Then $h\circ g\colon Y\to W$ maps both $a$ and $b$ to $1$. Note that $g$ is surjective, $h$ is injective, but $h\circ g$ is neither. So: surjective followed by injective could be neither.

Playing around with similar examples will show you that injective followed by surjective may also be neither. For instance, modify the first example above a bit, say $Y = \{a,b,c\}$, $Z = \{\bullet,\dagger\}$, $f\colon X\to Y$ given by $f(1)=a$, $f(2)=b$ (injective), and $g\colon Y\to Z$ given by $g(a)=g(b)=\bullet$, $g(c)=\dagger$ (surjective). Is $g\circ f$ injective? Is it surjective?

Arturo Magidin
  • 398,050
2

When you write $x$ in $f(x)=x^2$, it is a "dummy variable" in that you can put in anything in the proper range (here presumably the real numbers). So $f(g(x))=(g(x))^2$. Then you can expand the right side by inserting what you know about $g(x)$. Getting $g(f(x))$ is similar. Then for the injective/surjective part you could look at this question

Ross Millikan
  • 374,822
2

You should specify the domains and codomains of your functions. I guess that $f:\mathbb{R}\rightarrow\mathbb{R}_{\geq 0}$ and $g:\mathbb{R}\rightarrow\mathbb{R}$, but there are some other natural definitions you could make. You can write down the compositions explicitly: $f\circ g:\mathbb{R}\rightarrow\mathbb{R}_{\geq 0}$ has $x\mapsto (e^x)^2=e^{2x}$. This is injective (since $x\mapsto e^x$ is injective) and not surjective, since 0 is not in the image. $g\circ f:\mathbb{R}\rightarrow\mathbb{R}$ $x\mapsto e^{x^2}$ is neither injective, nor surjective.

MichalisN
  • 5,402