>I am about to restore my computer to factory settings. Which, I believe, will wipe out drive C:. Drive C: is where all SQL Server 2008 databases are stored. I cannot start SQL Server. So the only way I can "back up" the databases is copy them to an external drive.
>Will I be able to "restore" these .MDF and .LDF file on the SQL Server that I will install later? How?
Not sure that's actually possible, I've never had much success. The reason for that is probably that I've changed paths, changed server name or something, and it never matched. While a dbf header holds the relative path to a dbc, in case of SQL server all paths are absolute. Which is the reason why you can't just move files around even when you have a fully functioning server. You need to detach (which probably deletes the entries in master db and writes some self-referential stuff into the mdf itself) and then attach (and hope it works).
Since you can't do it now, you can only copy everything together, i.e. the whole set of folders where mdf and ldf files are, install from scratch using the same locations for everything, backup that (in case you end up with an unusable setup in the end), then stop SQL service, restore your backup, cross fingers, start service.