Injectivity of $f(x) = x + [x/2]$, and finding an explicit inverse

Context:

This question comes up as a tangent to an earlier MSE question from today. The OP of this question was, in effect, seeking an explicit inverse to the function

$$f(x) = x + \left[ \frac{x}{2} \right]$$

where $$[n]$$ denotes the rounding function, i.e. outputs $$n$$ rounded to the nearest integer. It turned out the OP was mistaken and meant to ask about a different function, but this brought about an interesting thought as I played around with it.

The Problem / My Questions:

Let $$f$$ be as defined previously. On an intuitive glance at the graph of this function, we can see it is injective:

However, a rigorous proof of this (i.e. $$f(x_1) = f(x_2) \implies x_1 = x_2$$) eludes me, namely because of that rounding function. The function $$g(x) = x$$ is injective, yet $$h(x) = [x/2]$$ isn't (consider $$x_1 = 2$$ and $$x_2 = 2.2$$). So obviously it is possible to have an injective function which is the sum of two functions which are not necessarily injective.

I've tried rigorously proving the injectivity of $$f$$, making use of various identities from Wikipedia - you can express $$[n]$$ as $$\lfloor n + 0.5 \rfloor$$, so since this page had lots of identities (as opposed to their rounding function page) I figured it'd be useful. No real headway, though.

Which brings up my questions:

• How would one prove the injectivity of $$f$$? So far in my coursework I've typically only done so from the definition. Perhaps there's a different trick to use in this case - a property of injective functions perhaps, or perhaps a property of the rounding, floor, or ceiling functions?

• How would one find the inverse of $$f$$? Clearly, to each $$x$$, there is a unique $$f(x)$$, so, in theory, it seems like you'd be able to invert the function, to be able to express $$x$$ in terms of $$f(x)$$. This obviously isn't true for the related three functions $$a(x) = \lfloor x \rfloor = \text{floor}(x) \;\;\;\;\;\; b(x) = \lceil x \rceil = \text{ceiling}(x) \;\;\;\;\;\; c(x) = [x] = \text{round}(x)$$ but it seems like introducing the lone $$x$$ term (as in $$f$$) that would normally change the dynamic. Is it possible that there are indeed just injective (or, what would be even more strange from my experience, bijective) functions for which we cannot find an explicit inverse?

• Ahhh, I see, I didn't think to do that, really simple when you frame it that way. Though $f$ is not $f(x) = x + [x]$ here, but I think that's a good enough nudge for me to try proving it myself (it's not a whole lot different). So thanks for that insight! ^_^ – Eevee Trainer Jan 3 at 1:41
• Since the comment was deleted, the insight in question: let $x \in \mathbb{R}$. Then there exists some $n \in \mathbb{N}$ such that $$n \leq x \leq n+1$$ Thus, $x$ can be expressed by $x = n + \{x\}$, where $\{x\}$ denotes the fractional part of $x$. Consider this in the definition of injectivity and the proof should follow reasonably smoothly. (Which only leaves the tenet of an explicit inverse to address.) – Eevee Trainer Jan 3 at 1:43

Define $$f:\mathbb{R}\rightarrow\mathbb{R}$$ by $$f(x)=x+\left[\frac{x}{2}\right]$$. Let $$x_0 be real numbers. Then $$f(x_0), and thus $$f$$ is injective!
Basically, we can leverage the ordering of the reals in order to get at injectivity at little easier. Each component of $$f$$ is increasing, and the $$x$$ part is strictly increasing, and monotonicity (of the same type) is preserved under addition.
• To be fair, we're using the rounding function, not floor, but I think the same idea more or less applies. Personally still like the angle that used the fractional part of $x$ and whatnot from the comments more - it was just more immediately obviously to me. Still, thanks for the (additional) insight! ^_^ – Eevee Trainer Jan 3 at 1:53