# Is there a real continuous function that extends the domain of this function? [closed]

Is there a real continuous function that extends the domain of this function?

$$f(k) \begin{cases} if \:k \equiv 1 \:\mod\:2, \quad f(k) = \frac{k+1}{k}\\ \\if \:k \equiv 0 \:\mod\: 2, \quad f(k) = \frac{k-1}{k} \end{cases}$$ Graph of the function

• There are billion continuous functions that interpolate given points, where is the problem ?
– user65203
May 16, 2018 at 13:25

$$f(x)=\frac{x-1}x \cos^2 \left(\frac{\pi}2x\right)+\frac{x+1}x \sin^2 \left(\frac{\pi}2x\right)$$

which can be simplified by trigonometric identities

$$f(x)=1-\frac1x\left[2\cos^2 \left(\frac{\pi}2x\right)-1\right] =1-\frac{\cos \left(\pi x\right)}x$$

• Yes! Thank you so much! That's perfect! May 16, 2018 at 13:26
• @HenningMakholm Yes of course it can be simplified, I've let the full expression to see how it works.
– user
May 16, 2018 at 13:29

example $$f(x) = 1 - {1 \over x}\left( {\cos \pi x} \right)$$

• Yo Nice Function! Thank you so much for the answer! May 16, 2018 at 13:30

$$f(x)=\begin{cases} 1 & \text{when }x=0 \\ 1 - \frac1x\bigl(\cos(\pi x) - \sin(\pi x)/\pi x\bigr) & \text{otherwise} \end{cases}$$ is continuous (in fact real analytic) on all of $\mathbb R$ and agrees with your original definition at all points where it is defined.