Is it safe to use a laptop if the CPU fan is failing?

Will it work? Sure. Is it "safe"? Maybe

Modern CPUs, especially mobile ones, feature thermal throttling in order to protect them from extreme temperatures. What this means is that if a fan fails while the system is in operation then the CPU will limit itself in order to prevent damage caused by overheating. Your system performance can be severely hampered by this throttling.

While this can ensure that a system is likely to be protected from a failure you shouldn't count on it as a permanent saviour. Electronic components don't like being at their maximum limits for extended periods. Extreme hot/cold cycles can cause mechanical stress and lead to components breaking prematurely.

The fan heatsink may be connected to the CPU, but by keeping the CPU cool it also allows other components (such as power converters and interface chips) to shed heat easier.

I would only use such a system lightly and with caution. It will not be working at peak performance and will be at risk of further damage due to high temperatures around sensitive components.

No, this is not safe. Stop using your computer right now.

Maybe, just maybe, the CPU will protect itself from immediate death by thermal throttling or emergency shutdown.

However, the fan in a laptop does not only cool the CPU, it also cools other components in the system. Anything in your system may break including irreparable damages to main board, memory, or your disk and thus permanent loss of data. Even a emergency thermal shutdown can easily corrupt your data or file system.

If you value your hardware or data, you should not use the system until it is properly cooled again.

You're taking a risk, but I don't think it's as clear cut as other people are saying.

I have a 12yo Core 1 Duo laptop that I've been torturing with distributed computing just to see how long it'll last (from a perf/watt standpoint it's well past when it should've been retired). This basically consists of running at 100% load 24/7/365.

During that time I've killed its fan several times. And generally only discovered that I had done so after it began spontaneously shutting down due to overheating and after it happened several times I took a closer look and discovered the fan wasn't running (and IIRC the CPU was running well below normal speed). Since it wasn't shutting down immediately after the restarts prior to my discovering the bad fan's it has been running at max CPU temperature for a number of cumulative days/weeks.

You might not have as much luck as I have; and would be taking a risk but you've got a solid chance of coming out of it with nothing more than a few unexpected crashes.

If you want to do this, I'd recommend running a CPU temperature monitor to make sure your temps aren't hitting limits; and if you can't afford to replace the system if your luck does fail you probably should take the advice of the other answers and not tempt fate.

If you do this, I'd also suggest seeing if you can find a faster delivering source for the fan. In my experience, the cheapest Ebay/Amazon fan sellers have always been several week shipping direct from China vendors; but for a few extra dollars I could always find a seller in the US/UK that could get something to me in a fraction of the time.