Continuity of a piecewise defined function












0












$begingroup$


The function f(x) is defined by:



f(x)=x, if x is rational



f(x)=2x, if x is irrational



Is f continuous?



Now my answer was the following: let a=√2 (any irrational number would do). Then f(a)=2√2.
But, as x gets arbitrarily close to a, x is rational, so lim(x->a) of f(x)=√2, which is not equal to f(a), so f is not continuous.



Are there any flaws in my proof? My main question is, can we safely assume that x is rational as we let it get arbitrarily close (but not equal) to a?
Thanks in advance, and excuse my failure to use MathJax, but I cannot for the love of me get the mathematical notations to appear.










share|cite|improve this question









$endgroup$

















    0












    $begingroup$


    The function f(x) is defined by:



    f(x)=x, if x is rational



    f(x)=2x, if x is irrational



    Is f continuous?



    Now my answer was the following: let a=√2 (any irrational number would do). Then f(a)=2√2.
    But, as x gets arbitrarily close to a, x is rational, so lim(x->a) of f(x)=√2, which is not equal to f(a), so f is not continuous.



    Are there any flaws in my proof? My main question is, can we safely assume that x is rational as we let it get arbitrarily close (but not equal) to a?
    Thanks in advance, and excuse my failure to use MathJax, but I cannot for the love of me get the mathematical notations to appear.










    share|cite|improve this question









    $endgroup$















      0












      0








      0





      $begingroup$


      The function f(x) is defined by:



      f(x)=x, if x is rational



      f(x)=2x, if x is irrational



      Is f continuous?



      Now my answer was the following: let a=√2 (any irrational number would do). Then f(a)=2√2.
      But, as x gets arbitrarily close to a, x is rational, so lim(x->a) of f(x)=√2, which is not equal to f(a), so f is not continuous.



      Are there any flaws in my proof? My main question is, can we safely assume that x is rational as we let it get arbitrarily close (but not equal) to a?
      Thanks in advance, and excuse my failure to use MathJax, but I cannot for the love of me get the mathematical notations to appear.










      share|cite|improve this question









      $endgroup$




      The function f(x) is defined by:



      f(x)=x, if x is rational



      f(x)=2x, if x is irrational



      Is f continuous?



      Now my answer was the following: let a=√2 (any irrational number would do). Then f(a)=2√2.
      But, as x gets arbitrarily close to a, x is rational, so lim(x->a) of f(x)=√2, which is not equal to f(a), so f is not continuous.



      Are there any flaws in my proof? My main question is, can we safely assume that x is rational as we let it get arbitrarily close (but not equal) to a?
      Thanks in advance, and excuse my failure to use MathJax, but I cannot for the love of me get the mathematical notations to appear.







      continuity






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Dec 17 '18 at 18:43









      JBuckJBuck

      566




      566






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          Your proof is not quite correct. In particular, the statement "as $x$ gets arbitrarily close to $a$, $x$ is rational" is not correct. In fact, no matter how close $x$ gets to $a$, there will always be rational and irrational numbers between $x$ and $a$.



          For $f$ to be continuous at a point $x=a,$ we would need $lim_{xto a}f(x)=f(a)$. That means that for all $epsilon > 0$, there must be a $delta>0$ such that if $xin(a-delta, a+delta)$, $f(x)in (f(a)-epsilon, f(a)+epsilon)$. This clearly cannot happen in this case because any interval $(a-delta,a+delta)$ contains rational and irrational numbers, so the values of $f(x)$ cannot all be within $epsilon$ of $f(a)$ (whether $a$ is rational or irrational).



          Let's see what this would look like for your choice of $a= sqrt{2}$ with $f(a)=2sqrt{2}$. Let $epsilon=sqrt{2}$. For any $delta>0$, the interval $(a-delta,a)$ contains a rational number, call it $q$. Then
          $$f(a)-f(q)=2sqrt{2}-q>2sqrt{2}-sqrt{2}=sqrt{2}=epsilon$$






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Thank you! Unfortunately I haven't yet been taught this definition of continuity, therefore I get the general idea of your proof, but it will require extra effort and serious thinking on my part to grasp all the little details.
            $endgroup$
            – JBuck
            Dec 17 '18 at 19:36










          • $begingroup$
            What definition of continuity have you seen? I just used the standard $epsilon-delta$ definition here.
            $endgroup$
            – pwerth
            Dec 17 '18 at 19:44










          • $begingroup$
            The definition that was given to us said that if the limit of f as x approaches a exists and is equal to f(a), then f is continuous at a. Moreover, the definition of a limit we were given was "in words" and did not include any of the formal notation with ε, δ and such.
            $endgroup$
            – JBuck
            Dec 17 '18 at 20:51










          • $begingroup$
            As a side note, I now think I have the grasp of the proof, except for one thing: "...so the values of f(x) cannot all be within ϵ of f(a) (whether a is rational or irrational)" . By that, you mean that, for this particular function, no matter the ε, δ, there will always be a number that is outside the specified interval?
            $endgroup$
            – JBuck
            Dec 17 '18 at 20:58










          • $begingroup$
            What does it mean to say that the limit of $f$ as $x$ approaches $a$ exists and is equal to $f(a)$? If you write this out, this will be precisely the conditions I wrote! And yes, what I mean is that if $epsilon<sqrt{2}$, there is no way to ensure that all function values are within $epsilon$ of $f(a)=f(sqrt{2})$ because of the way the function is defined.
            $endgroup$
            – pwerth
            Dec 18 '18 at 5:11











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3044285%2fcontinuity-of-a-piecewise-defined-function%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0












          $begingroup$

          Your proof is not quite correct. In particular, the statement "as $x$ gets arbitrarily close to $a$, $x$ is rational" is not correct. In fact, no matter how close $x$ gets to $a$, there will always be rational and irrational numbers between $x$ and $a$.



          For $f$ to be continuous at a point $x=a,$ we would need $lim_{xto a}f(x)=f(a)$. That means that for all $epsilon > 0$, there must be a $delta>0$ such that if $xin(a-delta, a+delta)$, $f(x)in (f(a)-epsilon, f(a)+epsilon)$. This clearly cannot happen in this case because any interval $(a-delta,a+delta)$ contains rational and irrational numbers, so the values of $f(x)$ cannot all be within $epsilon$ of $f(a)$ (whether $a$ is rational or irrational).



          Let's see what this would look like for your choice of $a= sqrt{2}$ with $f(a)=2sqrt{2}$. Let $epsilon=sqrt{2}$. For any $delta>0$, the interval $(a-delta,a)$ contains a rational number, call it $q$. Then
          $$f(a)-f(q)=2sqrt{2}-q>2sqrt{2}-sqrt{2}=sqrt{2}=epsilon$$






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Thank you! Unfortunately I haven't yet been taught this definition of continuity, therefore I get the general idea of your proof, but it will require extra effort and serious thinking on my part to grasp all the little details.
            $endgroup$
            – JBuck
            Dec 17 '18 at 19:36










          • $begingroup$
            What definition of continuity have you seen? I just used the standard $epsilon-delta$ definition here.
            $endgroup$
            – pwerth
            Dec 17 '18 at 19:44










          • $begingroup$
            The definition that was given to us said that if the limit of f as x approaches a exists and is equal to f(a), then f is continuous at a. Moreover, the definition of a limit we were given was "in words" and did not include any of the formal notation with ε, δ and such.
            $endgroup$
            – JBuck
            Dec 17 '18 at 20:51










          • $begingroup$
            As a side note, I now think I have the grasp of the proof, except for one thing: "...so the values of f(x) cannot all be within ϵ of f(a) (whether a is rational or irrational)" . By that, you mean that, for this particular function, no matter the ε, δ, there will always be a number that is outside the specified interval?
            $endgroup$
            – JBuck
            Dec 17 '18 at 20:58










          • $begingroup$
            What does it mean to say that the limit of $f$ as $x$ approaches $a$ exists and is equal to $f(a)$? If you write this out, this will be precisely the conditions I wrote! And yes, what I mean is that if $epsilon<sqrt{2}$, there is no way to ensure that all function values are within $epsilon$ of $f(a)=f(sqrt{2})$ because of the way the function is defined.
            $endgroup$
            – pwerth
            Dec 18 '18 at 5:11
















          0












          $begingroup$

          Your proof is not quite correct. In particular, the statement "as $x$ gets arbitrarily close to $a$, $x$ is rational" is not correct. In fact, no matter how close $x$ gets to $a$, there will always be rational and irrational numbers between $x$ and $a$.



          For $f$ to be continuous at a point $x=a,$ we would need $lim_{xto a}f(x)=f(a)$. That means that for all $epsilon > 0$, there must be a $delta>0$ such that if $xin(a-delta, a+delta)$, $f(x)in (f(a)-epsilon, f(a)+epsilon)$. This clearly cannot happen in this case because any interval $(a-delta,a+delta)$ contains rational and irrational numbers, so the values of $f(x)$ cannot all be within $epsilon$ of $f(a)$ (whether $a$ is rational or irrational).



          Let's see what this would look like for your choice of $a= sqrt{2}$ with $f(a)=2sqrt{2}$. Let $epsilon=sqrt{2}$. For any $delta>0$, the interval $(a-delta,a)$ contains a rational number, call it $q$. Then
          $$f(a)-f(q)=2sqrt{2}-q>2sqrt{2}-sqrt{2}=sqrt{2}=epsilon$$






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Thank you! Unfortunately I haven't yet been taught this definition of continuity, therefore I get the general idea of your proof, but it will require extra effort and serious thinking on my part to grasp all the little details.
            $endgroup$
            – JBuck
            Dec 17 '18 at 19:36










          • $begingroup$
            What definition of continuity have you seen? I just used the standard $epsilon-delta$ definition here.
            $endgroup$
            – pwerth
            Dec 17 '18 at 19:44










          • $begingroup$
            The definition that was given to us said that if the limit of f as x approaches a exists and is equal to f(a), then f is continuous at a. Moreover, the definition of a limit we were given was "in words" and did not include any of the formal notation with ε, δ and such.
            $endgroup$
            – JBuck
            Dec 17 '18 at 20:51










          • $begingroup$
            As a side note, I now think I have the grasp of the proof, except for one thing: "...so the values of f(x) cannot all be within ϵ of f(a) (whether a is rational or irrational)" . By that, you mean that, for this particular function, no matter the ε, δ, there will always be a number that is outside the specified interval?
            $endgroup$
            – JBuck
            Dec 17 '18 at 20:58










          • $begingroup$
            What does it mean to say that the limit of $f$ as $x$ approaches $a$ exists and is equal to $f(a)$? If you write this out, this will be precisely the conditions I wrote! And yes, what I mean is that if $epsilon<sqrt{2}$, there is no way to ensure that all function values are within $epsilon$ of $f(a)=f(sqrt{2})$ because of the way the function is defined.
            $endgroup$
            – pwerth
            Dec 18 '18 at 5:11














          0












          0








          0





          $begingroup$

          Your proof is not quite correct. In particular, the statement "as $x$ gets arbitrarily close to $a$, $x$ is rational" is not correct. In fact, no matter how close $x$ gets to $a$, there will always be rational and irrational numbers between $x$ and $a$.



          For $f$ to be continuous at a point $x=a,$ we would need $lim_{xto a}f(x)=f(a)$. That means that for all $epsilon > 0$, there must be a $delta>0$ such that if $xin(a-delta, a+delta)$, $f(x)in (f(a)-epsilon, f(a)+epsilon)$. This clearly cannot happen in this case because any interval $(a-delta,a+delta)$ contains rational and irrational numbers, so the values of $f(x)$ cannot all be within $epsilon$ of $f(a)$ (whether $a$ is rational or irrational).



          Let's see what this would look like for your choice of $a= sqrt{2}$ with $f(a)=2sqrt{2}$. Let $epsilon=sqrt{2}$. For any $delta>0$, the interval $(a-delta,a)$ contains a rational number, call it $q$. Then
          $$f(a)-f(q)=2sqrt{2}-q>2sqrt{2}-sqrt{2}=sqrt{2}=epsilon$$






          share|cite|improve this answer









          $endgroup$



          Your proof is not quite correct. In particular, the statement "as $x$ gets arbitrarily close to $a$, $x$ is rational" is not correct. In fact, no matter how close $x$ gets to $a$, there will always be rational and irrational numbers between $x$ and $a$.



          For $f$ to be continuous at a point $x=a,$ we would need $lim_{xto a}f(x)=f(a)$. That means that for all $epsilon > 0$, there must be a $delta>0$ such that if $xin(a-delta, a+delta)$, $f(x)in (f(a)-epsilon, f(a)+epsilon)$. This clearly cannot happen in this case because any interval $(a-delta,a+delta)$ contains rational and irrational numbers, so the values of $f(x)$ cannot all be within $epsilon$ of $f(a)$ (whether $a$ is rational or irrational).



          Let's see what this would look like for your choice of $a= sqrt{2}$ with $f(a)=2sqrt{2}$. Let $epsilon=sqrt{2}$. For any $delta>0$, the interval $(a-delta,a)$ contains a rational number, call it $q$. Then
          $$f(a)-f(q)=2sqrt{2}-q>2sqrt{2}-sqrt{2}=sqrt{2}=epsilon$$







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Dec 17 '18 at 19:07









          pwerthpwerth

          2,898416




          2,898416












          • $begingroup$
            Thank you! Unfortunately I haven't yet been taught this definition of continuity, therefore I get the general idea of your proof, but it will require extra effort and serious thinking on my part to grasp all the little details.
            $endgroup$
            – JBuck
            Dec 17 '18 at 19:36










          • $begingroup$
            What definition of continuity have you seen? I just used the standard $epsilon-delta$ definition here.
            $endgroup$
            – pwerth
            Dec 17 '18 at 19:44










          • $begingroup$
            The definition that was given to us said that if the limit of f as x approaches a exists and is equal to f(a), then f is continuous at a. Moreover, the definition of a limit we were given was "in words" and did not include any of the formal notation with ε, δ and such.
            $endgroup$
            – JBuck
            Dec 17 '18 at 20:51










          • $begingroup$
            As a side note, I now think I have the grasp of the proof, except for one thing: "...so the values of f(x) cannot all be within ϵ of f(a) (whether a is rational or irrational)" . By that, you mean that, for this particular function, no matter the ε, δ, there will always be a number that is outside the specified interval?
            $endgroup$
            – JBuck
            Dec 17 '18 at 20:58










          • $begingroup$
            What does it mean to say that the limit of $f$ as $x$ approaches $a$ exists and is equal to $f(a)$? If you write this out, this will be precisely the conditions I wrote! And yes, what I mean is that if $epsilon<sqrt{2}$, there is no way to ensure that all function values are within $epsilon$ of $f(a)=f(sqrt{2})$ because of the way the function is defined.
            $endgroup$
            – pwerth
            Dec 18 '18 at 5:11


















          • $begingroup$
            Thank you! Unfortunately I haven't yet been taught this definition of continuity, therefore I get the general idea of your proof, but it will require extra effort and serious thinking on my part to grasp all the little details.
            $endgroup$
            – JBuck
            Dec 17 '18 at 19:36










          • $begingroup$
            What definition of continuity have you seen? I just used the standard $epsilon-delta$ definition here.
            $endgroup$
            – pwerth
            Dec 17 '18 at 19:44










          • $begingroup$
            The definition that was given to us said that if the limit of f as x approaches a exists and is equal to f(a), then f is continuous at a. Moreover, the definition of a limit we were given was "in words" and did not include any of the formal notation with ε, δ and such.
            $endgroup$
            – JBuck
            Dec 17 '18 at 20:51










          • $begingroup$
            As a side note, I now think I have the grasp of the proof, except for one thing: "...so the values of f(x) cannot all be within ϵ of f(a) (whether a is rational or irrational)" . By that, you mean that, for this particular function, no matter the ε, δ, there will always be a number that is outside the specified interval?
            $endgroup$
            – JBuck
            Dec 17 '18 at 20:58










          • $begingroup$
            What does it mean to say that the limit of $f$ as $x$ approaches $a$ exists and is equal to $f(a)$? If you write this out, this will be precisely the conditions I wrote! And yes, what I mean is that if $epsilon<sqrt{2}$, there is no way to ensure that all function values are within $epsilon$ of $f(a)=f(sqrt{2})$ because of the way the function is defined.
            $endgroup$
            – pwerth
            Dec 18 '18 at 5:11
















          $begingroup$
          Thank you! Unfortunately I haven't yet been taught this definition of continuity, therefore I get the general idea of your proof, but it will require extra effort and serious thinking on my part to grasp all the little details.
          $endgroup$
          – JBuck
          Dec 17 '18 at 19:36




          $begingroup$
          Thank you! Unfortunately I haven't yet been taught this definition of continuity, therefore I get the general idea of your proof, but it will require extra effort and serious thinking on my part to grasp all the little details.
          $endgroup$
          – JBuck
          Dec 17 '18 at 19:36












          $begingroup$
          What definition of continuity have you seen? I just used the standard $epsilon-delta$ definition here.
          $endgroup$
          – pwerth
          Dec 17 '18 at 19:44




          $begingroup$
          What definition of continuity have you seen? I just used the standard $epsilon-delta$ definition here.
          $endgroup$
          – pwerth
          Dec 17 '18 at 19:44












          $begingroup$
          The definition that was given to us said that if the limit of f as x approaches a exists and is equal to f(a), then f is continuous at a. Moreover, the definition of a limit we were given was "in words" and did not include any of the formal notation with ε, δ and such.
          $endgroup$
          – JBuck
          Dec 17 '18 at 20:51




          $begingroup$
          The definition that was given to us said that if the limit of f as x approaches a exists and is equal to f(a), then f is continuous at a. Moreover, the definition of a limit we were given was "in words" and did not include any of the formal notation with ε, δ and such.
          $endgroup$
          – JBuck
          Dec 17 '18 at 20:51












          $begingroup$
          As a side note, I now think I have the grasp of the proof, except for one thing: "...so the values of f(x) cannot all be within ϵ of f(a) (whether a is rational or irrational)" . By that, you mean that, for this particular function, no matter the ε, δ, there will always be a number that is outside the specified interval?
          $endgroup$
          – JBuck
          Dec 17 '18 at 20:58




          $begingroup$
          As a side note, I now think I have the grasp of the proof, except for one thing: "...so the values of f(x) cannot all be within ϵ of f(a) (whether a is rational or irrational)" . By that, you mean that, for this particular function, no matter the ε, δ, there will always be a number that is outside the specified interval?
          $endgroup$
          – JBuck
          Dec 17 '18 at 20:58












          $begingroup$
          What does it mean to say that the limit of $f$ as $x$ approaches $a$ exists and is equal to $f(a)$? If you write this out, this will be precisely the conditions I wrote! And yes, what I mean is that if $epsilon<sqrt{2}$, there is no way to ensure that all function values are within $epsilon$ of $f(a)=f(sqrt{2})$ because of the way the function is defined.
          $endgroup$
          – pwerth
          Dec 18 '18 at 5:11




          $begingroup$
          What does it mean to say that the limit of $f$ as $x$ approaches $a$ exists and is equal to $f(a)$? If you write this out, this will be precisely the conditions I wrote! And yes, what I mean is that if $epsilon<sqrt{2}$, there is no way to ensure that all function values are within $epsilon$ of $f(a)=f(sqrt{2})$ because of the way the function is defined.
          $endgroup$
          – pwerth
          Dec 18 '18 at 5:11


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3044285%2fcontinuity-of-a-piecewise-defined-function%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Bressuire

          Cabo Verde

          Gyllenstierna