Limits Of Functions

1. Oct 13, 2009

Juggler123

I have been asked to give an example of a function form R to R thats fails to have limit as x tends to infinity but for which f(x)^2 tends to 4 as x tends to infinity.

I've had a go at this but the functions I can think of that don't have limits as x tends to infinity are the trigonemetric ones which dosen't help when looking at f(x)^2.

Can anyone help?

2. Oct 13, 2009

HallsofIvy

Try f(x)= 1 if x is rational, -1, if x is irrational. That function has no limit as x tends to anything but f(x)2= 1.