# What is the set of all values taken by $f(x) = \lfloor x \rfloor + (x - \lfloor x \rfloor) ^2$

Let $$f(x) = \lfloor x \rfloor + (x - \lfloor x \rfloor)^2$$ for all $$x \in \mathbb{R}$$. Then what is the set of all values taken by the function $$f$$?

My intuition is: if we take $$x$$ as an integer then $$\lfloor x \rfloor =x$$ hence $$f(x) = x$$. When $$x$$ is not an integer then $$(x - \lfloor x \rfloor)$$ is the fractional part of $$x$$ and its square will be a positive fraction also.

Now can I say that this process will generate all $$\mathbb{R}-\mathbb{Z}$$?

I would like to have a proof if I am correct.

• What do you mean by [x], just rounding x? Aug 18, 2019 at 19:12
• That often means $\lfloor x \rfloor$ in lower level courses, @callculus
– MPW
Aug 18, 2019 at 19:15
• @callculus Like [1.5]=1 i.e.[x]=integer that is not greater than x. Aug 18, 2019 at 19:16

For all $$x\in\mathbb{R}$$ we can write $$x=\lfloor x\rfloor+\{x\}$$ where $$\{x\}$$ denotes the fractional part of $$x$$. Thus we have that $$f(x)=\lfloor x\rfloor+\{x\}^2$$ I will now prove that for any $$y\in\mathbb{R}$$ there exists some $$x\in\mathbb{R}$$ such that $$y=f(x)$$. Note that this is equivalent to $$y=\lfloor y\rfloor+\{y\}=\lfloor x\rfloor+\{x\}^2=f(x)$$ Hence, by comparing integer and fractional parts, we need $$\lfloor x\rfloor=\lfloor y\rfloor$$ and $$\{x\}^2=\{y\}$$. Thus, for exactly $$x=\lfloor y\rfloor+\sqrt{\{y\}}$$, we have that $$f(x)=y$$. This means that the domain and range of $$f(x)$$ is $$\mathbb{R}$$.