# continuity of floor function in $\mathbb Z$

Suppose $$f(x)=\left|x-2\left\lfloor\frac{x+1}{2}\right\rfloor\right|$$ To prove the continuity of $f$ in $\mathbb {R}$ we have to prove it first in $\mathbb {Z}$ then at $\mathbb{R} - \mathbb{Z}$. But why do we have to prove the continuity if $x=2n$ and $x=2n-1$ ($n \in \mathbb {N}$ odd or even) when we want to prove the continuity in $\mathbb {Z}$? (I saw this in a solution but I didn't understand it)

-

## 2 Answers

Presumably, the solution that you read thought that the best way to show continuity for all integers was to to it in two cases: when we have odd integers and when we have even integers.

To show that the function is continuous at all integers is equivalent to showing that it's continuous at both the even and odd integers.

-

If you try to draw a graph of this function, you'll see why it's necessary to deal with even and odd numbers separately. Basically, it's a kind of zigzag - at each integer, it has a sharp tooth. Its continuity away from the integers is never in any doubt; but the reason why it's continuous at the upward-pointing teeth (odd integers) is completely different from the reason why it's continuous at the downward-pointing teeth (even integers). It would be disproportionately difficult to try and give a continuity proof that works for all integers, without splitting them into the two separate cases.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 9, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.967876672744751, "perplexity_flag": "head"}