This question summarizes the definitions of surjective and injective, and applies them to prove the existence of an inverse.

\n\n

It is possible to prove that a continuous function is injective by using the derivative to show that it is either strictly increasing or strictly decreasing. But $f$ is not continuous, and nor is it strictly increasing or strictly decreasing. In fact it is strictly decreasing for $x<0$ and strictly increasing for $x>0$.

\n{myscript()}

\nSo we have to prove that $f$ is injective directly from the definition.

\n\n

By showing that $f$ is a bijection we prove that an inverse exists, but we have not constructed the inverse function. This is an interesting case because we are able to explicitly construct the inverse, which also proves that the inverse exists.

", "metadata": {"description": "This question summarizes the definitions of surjective and injective, and applies them to prove the existance of an inverse.

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "extensions": ["jsxgraph"], "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": [], "parts": [{"prompt": "**Prove that $f(x)$ surjective.**

Assume that $b \\in \\mathbb R$. We must find some $a$ such that $f(a) = b$. There are two cases to consider.

\nIf $b=0$ then choose $a = 0$.

\nOtherwise, $b \\neq 0$ and then choose $a = $ [[0]].

\nIn either case, $f(a) = b$ and so the function is surjective.

", "type": "gapfill", "showCorrectAnswer": true, "scripts": {}, "variableReplacements": [], "marks": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "gaps": [{"type": "jme", "vsetrange": [0, 1], "variableReplacementStrategy": "originalfirst", "vsetrangepoints": 5, "checkingtype": "absdiff", "showFeedbackIcon": true, "checkvariablenames": false, "showCorrectAnswer": true, "scripts": {}, "variableReplacements": [], "expectedvariablenames": [], "marks": 1, "answer": "1/b", "checkingaccuracy": 0.001, "showpreview": true}]}, {"prompt": "**Prove that $f(x)$ is injective.**

Assume that $f(x_0) = f(x_1)$. We must prove that $x_0 = x_1$. There are two cases to consider.

\nIf $f(x_0) = f(x_1) = 0$ then $x_0 = x_1 = $ [[0]].

\nOtherwise, $f(x_0) = f(x_1) \\neq 0$ and then

\n$x_0 = \\frac{1}{f(x_0)} = \\frac{1}{f(x_1)} = x_1$.

\nIn either case, $x_0 = x_1$ and so the function is injective.

", "type": "gapfill", "showCorrectAnswer": true, "scripts": {}, "variableReplacements": [], "marks": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "gaps": [{"mustBeReducedPC": 0, "correctAnswerStyle": "plain", "type": "numberentry", "mustBeReduced": false, "allowFractions": false, "maxValue": "0", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "scripts": {}, "variableReplacements": [], "minValue": "0", "marks": 1, "correctAnswerFraction": false}]}, {"prompt": "Because $f$ is surjective and injective, it is bijective and therefore has an inverse.

\nIn this case we can actually see that $f$ is its own inverse because $f(f(x)) = $ [[0]].

", "type": "gapfill", "showCorrectAnswer": true, "scripts": {}, "variableReplacements": [], "marks": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "gaps": [{"type": "jme", "vsetrange": [0, 1], "variableReplacementStrategy": "originalfirst", "vsetrangepoints": 5, "checkingtype": "absdiff", "showFeedbackIcon": true, "checkvariablenames": false, "showCorrectAnswer": true, "scripts": {}, "variableReplacements": [], "expectedvariablenames": [], "marks": 1, "answer": "x", "checkingaccuracy": 0.001, "showpreview": true}]}], "preamble": {"css": "", "js": ""}, "functions": {"myscript": {"type": "html", "parameters": [], "definition": "// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in\n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n {boundingBox: [-4,4,4,-4],\n axis: true,\n showNavigation: false,\n grid: true\n });\n\n// div.board is the object created by JSXGraph, which you use to\n// manipulate elements\nvar board = div.board;\n\n// Then do whatever you want with the board....\nboard.create('functiongraph',[function(x){ return (0 == x ? 0 : 1/x);},0.01,4]);\nboard.create('functiongraph',[function(x){ return (0 == x ? 0 : 1/x);},-4,0.01]);\nvar p = board.createElement('point',[0,0], {visible: true, size:1, color:'blue',fixed:true});\np.setLabel(\"\");\n\n//var theLine = board.create('line',[[-4,0],[4,0]],{visible: false});\n//var x = board.create('glider',[theLine],{name:'x'});\n//var pointoncurve = board.create('point',[x.X(),(0 == x.X() ? 0 : 1/x.X())],{name:'f2',visible:true,size:3,color:'blue'});\n\n\n// and return the container div\nreturn div;", "language": "javascript"}}, "name": "Lois's copy of Functions: bijective", "statement": "A function which is both surjective and injective is said to be **bijective**.

This is an important property because it guarantees that $f: A \\mapsto B$ has an inverse function $f^{-1} : B \\mapsto A$.

\n\n

Let's prove that the function $f: \\mathbb R \\mapsto \\mathbb R$ defined by

\n$ f(x) = \\left\\{ \\begin{array}{cl} \\frac{1}x & x \\neq 0 \\\\ 0 & x = 0.\\end{array}\\right.$

\nhas an inverse.

\n", "rulesets": {}, "variables": {}, "type": "question", "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}]}]}], "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}]}